summaryrefslogtreecommitdiffstats
path: root/apps/theming
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-05-08 20:59:31 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-05-14 13:30:22 +0200
commit362e6b29038ae43d65114062c254774bc3b64803 (patch)
treee6024448bd9f7ff948af3d461d043a18b705d003 /apps/theming
parent3e07c4f73a80bfa7e5de5a9e0074d2c7d35f18cc (diff)
downloadnextcloud-server-362e6b29038ae43d65114062c254774bc3b64803.tar.gz
nextcloud-server-362e6b29038ae43d65114062c254774bc3b64803.zip
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/theming')
-rw-r--r--apps/theming/tests/IconBuilderTest.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php
index a2a330a2f24..1b9f204cd9e 100644
--- a/apps/theming/tests/IconBuilderTest.php
+++ b/apps/theming/tests/IconBuilderTest.php
@@ -25,13 +25,11 @@
*/
namespace OCA\Theming\Tests;
+use OC\Files\AppData\AppData;
use OCA\Theming\IconBuilder;
use OCA\Theming\ThemingDefaults;
use OCA\Theming\Util;
use OCP\App\IAppManager;
-use OCP\AppFramework\Http\NotFoundResponse;
-use OCP\Files\IAppData;
-use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\IConfig;
use PHPUnit\Framework\Error\Warning;
@@ -41,7 +39,7 @@ class IconBuilderTest extends TestCase {
/** @var IConfig */
protected $config;
- /** @var IAppData */
+ /** @var AppData */
protected $appData;
/** @var ThemingDefaults */
protected $themingDefaults;
@@ -56,7 +54,7 @@ class IconBuilderTest extends TestCase {
parent::setUp();
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
- $this->appData = $this->createMock(IAppData::class);
+ $this->appData = $this->createMock(AppData::class);
$this->themingDefaults = $this->getMockBuilder('OCA\Theming\ThemingDefaults')
->disableOriginalConstructor()->getMock();
$this->appManager = $this->getMockBuilder('OCP\App\IAppManager')->getMock();
@@ -127,6 +125,10 @@ class IconBuilderTest extends TestCase {
$this->themingDefaults->expects($this->once())
->method('getColorPrimary')
->willReturn($color);
+ $this->appData->expects($this->once())
+ ->method('getFolder')
+ ->with('images')
+ ->willThrowException(new NotFoundException());
$expectedIcon = new \Imagick(realpath(dirname(__FILE__)). "/data/" . $file);
$icon = new \Imagick();
@@ -156,6 +158,10 @@ class IconBuilderTest extends TestCase {
$this->themingDefaults->expects($this->once())
->method('getColorPrimary')
->willReturn($color);
+ $this->appData->expects($this->once())
+ ->method('getFolder')
+ ->with('images')
+ ->willThrowException(new NotFoundException());
$expectedIcon = new \Imagick(realpath(dirname(__FILE__)). "/data/" . $file);
$actualIcon = $this->iconBuilder->getFavicon($app);