aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/tests/ImageManagerTest.php
diff options
context:
space:
mode:
authorJulius Haertl <jus@bitgrid.net>2016-10-17 16:31:07 +0200
committerJulius Haertl <jus@bitgrid.net>2016-11-18 10:23:25 +0100
commit3a400f92d1936b2b752d813cbb27632d6acb9904 (patch)
tree3b9ab6f150ab8f54f457cb4eb0ec3a1e56a7049f /apps/theming/tests/ImageManagerTest.php
parentcc8b1d382910e13c0825e5a3fdb33276f65cf2bd (diff)
downloadnextcloud-server-3a400f92d1936b2b752d813cbb27632d6acb9904.tar.gz
nextcloud-server-3a400f92d1936b2b752d813cbb27632d6acb9904.zip
Replace null return with NotFoundException
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/tests/ImageManagerTest.php')
-rw-r--r--apps/theming/tests/ImageManagerTest.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/apps/theming/tests/ImageManagerTest.php b/apps/theming/tests/ImageManagerTest.php
index b52d557ab67..4df49633d80 100644
--- a/apps/theming/tests/ImageManagerTest.php
+++ b/apps/theming/tests/ImageManagerTest.php
@@ -86,10 +86,6 @@ class ImageManager extends TestCase {
public function testGetCachedImage() {
$folder = $this->setupCacheFolder();
$folder->expects($this->once())
- ->method('fileExists')
- ->with('filename')
- ->willReturn(true);
- $folder->expects($this->once())
->method('getFile')
->with('filename')
->willReturn('filecontent');
@@ -97,14 +93,16 @@ class ImageManager extends TestCase {
$this->assertEquals($expected, $this->imageManager->getCachedImage('filename'));
}
+ /**
+ * @expectedException \OCP\Files\NotFoundException
+ */
public function testGetCachedImageNotFound() {
$folder = $this->setupCacheFolder();
$folder->expects($this->once())
- ->method('fileExists')
+ ->method('getFile')
->with('filename')
- ->willReturn(false);
- $expected = null;
- $this->assertEquals($expected, $this->imageManager->getCachedImage('filename'));
+ ->will($this->throwException(new \OCP\Files\NotFoundException()));
+ $image = $this->imageManager->getCachedImage('filename');
}
public function testSetCachedImage() {