| @@ 98-107 (lines=10) @@ | ||
| 95 | /** |
|
| 96 | * @expectedException \eZ\Publish\Core\IO\Exception\BinaryFileNotFoundException |
|
| 97 | */ |
|
| 98 | public function testDeleteNotFound() |
|
| 99 | { |
|
| 100 | $this->filesystem |
|
| 101 | ->expects($this->once()) |
|
| 102 | ->method('delete') |
|
| 103 | ->with('prefix/my/file.png') |
|
| 104 | ->will($this->throwException(new FileNotFoundException('prefix/my/file.png'))); |
|
| 105 | ||
| 106 | $this->handler->delete('prefix/my/file.png'); |
|
| 107 | } |
|
| 108 | ||
| 109 | public function testGetContents() |
|
| 110 | { |
|
| @@ 126-138 (lines=13) @@ | ||
| 123 | /** |
|
| 124 | * @expectedException \eZ\Publish\Core\IO\Exception\BinaryFileNotFoundException |
|
| 125 | */ |
|
| 126 | public function testGetContentsNotFound() |
|
| 127 | { |
|
| 128 | $this->filesystem |
|
| 129 | ->expects($this->once()) |
|
| 130 | ->method('read') |
|
| 131 | ->with('prefix/my/file.png') |
|
| 132 | ->will($this->throwException(new FileNotFoundException('prefix/my/file.png'))); |
|
| 133 | ||
| 134 | self::assertEquals( |
|
| 135 | 'This is my contents', |
|
| 136 | $this->handler->getContents('prefix/my/file.png') |
|
| 137 | ); |
|
| 138 | } |
|
| 139 | ||
| 140 | public function testGetResource() |
|
| 141 | { |
|
| @@ 159-168 (lines=10) @@ | ||
| 156 | /** |
|
| 157 | * @expectedException \eZ\Publish\Core\IO\Exception\BinaryFileNotFoundException |
|
| 158 | */ |
|
| 159 | public function testGetResourceNotFound() |
|
| 160 | { |
|
| 161 | $this->filesystem |
|
| 162 | ->expects($this->once()) |
|
| 163 | ->method('readStream') |
|
| 164 | ->with('prefix/my/file.png') |
|
| 165 | ->will($this->throwException(new FileNotFoundException('prefix/my/file.png'))); |
|
| 166 | ||
| 167 | $this->handler->getResource('prefix/my/file.png'); |
|
| 168 | } |
|
| 169 | ||
| 170 | public function testGetUri() |
|
| 171 | { |
|
| @@ 120-129 (lines=10) @@ | ||
| 117 | /** |
|
| 118 | * @expectedException \eZ\Publish\Core\IO\Exception\BinaryFileNotFoundException |
|
| 119 | */ |
|
| 120 | public function testLoadNotFound() |
|
| 121 | { |
|
| 122 | $this->filesystem |
|
| 123 | ->expects($this->once()) |
|
| 124 | ->method('getMetadata') |
|
| 125 | ->with('prefix/my/file.png') |
|
| 126 | ->will($this->throwException(new FileNotFoundException('prefix/my/file.png'))); |
|
| 127 | ||
| 128 | $this->handler->load('prefix/my/file.png'); |
|
| 129 | } |
|
| 130 | ||
| 131 | public function testExists() |
|
| 132 | { |
|