1 | <?php |
||
10 | class TextFileReaderTest extends TestCase |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $file = './tests/files/urls.txt'; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $imageFile = './tests/files/images.jpg'; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $notReadable = './tests/files/urls_not_readable.txt'; |
||
26 | |||
27 | /** |
||
28 | * @covers \LazyEight\DiTesto\TextFileReader::__construct |
||
29 | * @uses \LazyEight\DiTesto\TextFileReader |
||
30 | * @return \LazyEight\DiTesto\TextFileReader |
||
31 | */ |
||
32 | public function testCanBeCreated() |
||
40 | |||
41 | /** |
||
42 | * @covers \LazyEight\DiTesto\TextFileReader::readFile |
||
43 | * @covers \LazyEight\DiTesto\TextFileReader::valid |
||
44 | * @covers \LazyEight\DiTesto\TextFileReader::validatePath |
||
45 | * @covers \LazyEight\DiTesto\TextFileReader::validateReadable |
||
46 | * @covers \LazyEight\DiTesto\TextFileReader::validateType |
||
47 | * @uses \LazyEight\DiTesto\TextFileReader |
||
48 | * @depends testCanBeCreated |
||
49 | * @uses \LazyEight\DiTesto\TextFileReader |
||
50 | * @param \LazyEight\DiTesto\TextFileLoader |
||
51 | */ |
||
52 | public function testCanBeLoaded(TextFileReader $loader) |
||
57 | |||
58 | /** |
||
59 | * @covers \LazyEight\DiTesto\TextFileReader::readFile |
||
60 | * @covers \LazyEight\DiTesto\TextFileReader::valid |
||
61 | * @covers \LazyEight\DiTesto\TextFileReader::validatePath |
||
62 | * @expectedException \LazyEight\DiTesto\Exceptions\IOException |
||
63 | * @uses \LazyEight\DiTesto\TextFileReader |
||
64 | */ |
||
65 | public function testCantBeLoaded() |
||
71 | |||
72 | /** |
||
73 | * @covers \LazyEight\DiTesto\TextFileReader::readFile |
||
74 | * @covers \LazyEight\DiTesto\TextFileReader::valid |
||
75 | * @covers \LazyEight\DiTesto\TextFileReader::validatePath |
||
76 | * @covers \LazyEight\DiTesto\TextFileReader::validateType |
||
77 | * @expectedException \LazyEight\DiTesto\Exceptions\IOException |
||
78 | */ |
||
79 | public function testInvalidType() |
||
85 | |||
86 | /** |
||
87 | * @covers \LazyEight\DiTesto\TextFileReader::readFile |
||
88 | * @covers \LazyEight\DiTesto\TextFileReader::valid |
||
89 | * @covers \LazyEight\DiTesto\TextFileReader::validatePath |
||
90 | * @covers \LazyEight\DiTesto\TextFileReader::validateReadable |
||
91 | * @expectedException \LazyEight\DiTesto\Exceptions\IOException |
||
92 | */ |
||
93 | public function testCantRead() |
||
101 | |||
102 | /** |
||
103 | * @covers \LazyEight\DiTesto\TextFileReader::readFile |
||
104 | * @covers \LazyEight\DiTesto\TextFileReader::getPath |
||
105 | * @uses \LazyEight\DiTesto\TextFileReader |
||
106 | */ |
||
107 | public function testCanGetPath() |
||
112 | } |
||
113 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.