summaryrefslogtreecommitdiffstats
path: root/apps/theming/tests/Controller
diff options
context:
space:
mode:
authorJulius Haertl <jus@bitgrid.net>2016-11-05 20:11:49 +0100
committerJulius Haertl <jus@bitgrid.net>2016-11-18 10:23:25 +0100
commitd409fe1c525ba05f342d52a9686ae395a0dac465 (patch)
tree955e8ef2ebf49cd3d336241a1474e96713ea4eda /apps/theming/tests/Controller
parent78de213b8582f160b9e3acd1d921a6dd1ccd88d9 (diff)
downloadnextcloud-server-d409fe1c525ba05f342d52a9686ae395a0dac465.tar.gz
nextcloud-server-d409fe1c525ba05f342d52a9686ae395a0dac465.zip
Error handling and tests if file was not found
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/tests/Controller')
-rw-r--r--apps/theming/tests/Controller/IconControllerTest.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/theming/tests/Controller/IconControllerTest.php b/apps/theming/tests/Controller/IconControllerTest.php
index b1742db018f..591c1075492 100644
--- a/apps/theming/tests/Controller/IconControllerTest.php
+++ b/apps/theming/tests/Controller/IconControllerTest.php
@@ -27,6 +27,7 @@ use OC\Files\SimpleFS\SimpleFile;
use OCA\Theming\ImageManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataDisplayResponse;
+use OCP\AppFramework\Http\NotFoundResponse;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\IConfig;
@@ -153,7 +154,7 @@ class IconControllerTest extends TestCase {
$expected->setStatus(Http::STATUS_NOT_FOUND);
$expected->cacheFor(0);
$expected->setLastModified(new \DateTime('now', new \DateTimeZone('GMT')));
- $this->assertEquals($expected, $this->iconController->getFavicon());
+ $this->assertInstanceOf(NotFoundResponse::class, $this->iconController->getFavicon());
}
public function testGetTouchIconDefault() {
@@ -194,11 +195,7 @@ class IconControllerTest extends TestCase {
$this->themingDefaults->expects($this->any())
->method('shouldReplaceIcons')
->willReturn(false);
- $expected = new Http\Response();
- $expected->setStatus(Http::STATUS_NOT_FOUND);
- $expected->cacheFor(0);
- $expected->setLastModified(new \DateTime('now', new \DateTimeZone('GMT')));
- $this->assertEquals($expected, $this->iconController->getTouchIcon());
+ $this->assertInstanceOf(NotFoundResponse::class, $this->iconController->getTouchIcon());
}
}