Completed
Push — master ( f2e7a7...9c404b )
by Victor
01:52
created

FileContentTest::testValueCanBeRetrieved()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: victor
5
 * Date: 10/04/16
6
 * Time: 02:04
7
 */
8
9
namespace Test\DiTesto;
10
11
12
use LazyEight\BasicTypes\Stringy;
13
use LazyEight\DiTesto\ValueObject\FileContent;
14
15
class FileContentTest extends \PHPUnit_Framework_TestCase
16
{
17
    /**
18
     * @var string
19
     */
20
    protected $file = './tests/files/urls.txt';
21
22
    /**
23
     * @covers \LazyEight\DiTesto\ValueObject\FileContent::__construct
24
     * @uses \LazyEight\DiTesto\ValueObject\FileContent
25
     * @return \LazyEight\DiTesto\ValueObject\FileContent
26
     */
27
    public function testCanBeCreated()
28
    {
29
        $instance = new FileContent(new Stringy(file_get_contents($this->file)));
30
        $this->assertInstanceOf(FileContent::class, $instance);
31
        return $instance;
32
    }
33
34
    /**
35
     * @covers \LazyEight\DiTesto\ValueObject\FileContent::getValue
36
     * @uses \LazyEight\DiTesto\ValueObject\FileContent
37
     * @depends testCanBeCreated
38
     * @uses \LazyEight\DiTesto\ValueObject\FileContent
39
     * @param \LazyEight\DiTesto\ValueObject\FileContent
40
     */
41
    public function testValueCanBeRetrieved(FileContent $content)
42
    {
43
        $this->assertEquals($content->getValue()->getValue(), new Stringy(file_get_contents($this->file)));
44
    }
45
}
46