1 | <?php |
||
12 | class FileSystemWriterTest extends TestCase |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $file = './tests/files/urls.txt'; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $path = './tests/files'; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $newFilename = 'newFilename.txt'; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $notReadable = './tests/files/urls_not_readable.txt'; |
||
33 | |||
34 | /** |
||
35 | * @covers \LazyEight\DiTesto\FileSystem\FileSystemWriter::__construct |
||
36 | * @uses \LazyEight\DiTesto\FileWriter |
||
37 | */ |
||
38 | public function testCanContruct() |
||
45 | |||
46 | /** |
||
47 | * @covers \LazyEight\DiTesto\FileSystem\FileSystemWriter::__construct |
||
48 | * @covers \LazyEight\DiTesto\FileSystem\FileSystemWriter::write |
||
49 | * @covers \LazyEight\DiTesto\FileSystem\FileSystemWriter::validate |
||
50 | * @uses \LazyEight\DiTesto\FileWriter |
||
51 | */ |
||
52 | public function testWriteNewFile() |
||
61 | |||
62 | /** |
||
63 | * @covers \LazyEight\DiTesto\FileSystem\FileSystemWriter::isWritable |
||
64 | * @uses \LazyEight\DiTesto\FileWriter |
||
65 | */ |
||
66 | public function testIsWriteable() |
||
76 | |||
77 | /** |
||
78 | * @covers \LazyEight\DiTesto\FileSystem\FileSystemWriter::validate |
||
79 | * @covers \LazyEight\DiTesto\FileSystem\FileSystemWriter::isWritablePath |
||
80 | * @expectedException \LazyEight\DiTesto\FileSystem\Exceptions\FileSystemException |
||
81 | */ |
||
82 | public function testCantWrite() |
||
93 | |||
94 | /** |
||
95 | * @covers \LazyEight\DiTesto\FileSystem\FileSystemWriter::validate |
||
96 | * @covers \LazyEight\DiTesto\FileSystem\FileSystemWriter::isWritablePath |
||
97 | * @expectedException \LazyEight\DiTesto\FileSystem\Exceptions\InvalidPathException |
||
98 | */ |
||
99 | public function testCantWriteDirectory() |
||
106 | |||
107 | /** |
||
108 | * @covers \LazyEight\DiTesto\FileSystem\FileSystemWriter::validate |
||
109 | * @covers \LazyEight\DiTesto\FileSystem\FileSystemWriter::isWritablePath |
||
110 | * @expectedException \LazyEight\DiTesto\FileSystem\Exceptions\InvalidPathException |
||
111 | */ |
||
112 | public function testCantWriteNoPermission() |
||
124 | |||
125 | /** |
||
126 | * @inheritDoc |
||
127 | */ |
||
128 | public static function tearDownAfterClass() |
||
143 | } |
||
144 |