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

FileContentTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 3
dl 0
loc 31
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanBeCreated() 0 6 1
A testValueCanBeRetrieved() 0 4 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