summaryrefslogtreecommitdiffstats
path: root/apps/theming/tests/Controller/ThemingControllerTest.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-11-18 15:35:34 +0100
committerGitHub <noreply@github.com>2016-11-18 15:35:34 +0100
commitfaee255ff47873ed2f8908c7d6b6e603ded11618 (patch)
tree87a46252211e9c0dbab91609e4115082401656ee /apps/theming/tests/Controller/ThemingControllerTest.php
parente8511660f01faeebcc692b57cabdacd97845da92 (diff)
parent2ab4d1e0a3f15af2b8f04edcf18b7fe3fc0be262 (diff)
downloadnextcloud-server-faee255ff47873ed2f8908c7d6b6e603ded11618.tar.gz
nextcloud-server-faee255ff47873ed2f8908c7d6b6e603ded11618.zip
Merge pull request #840 from nextcloud/theming-icon-endpoint
Add dynamic icon creation
Diffstat (limited to 'apps/theming/tests/Controller/ThemingControllerTest.php')
-rw-r--r--apps/theming/tests/Controller/ThemingControllerTest.php39
1 files changed, 38 insertions, 1 deletions
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php
index c9f6ff8a885..d42e5afb245 100644
--- a/apps/theming/tests/Controller/ThemingControllerTest.php
+++ b/apps/theming/tests/Controller/ThemingControllerTest.php
@@ -26,6 +26,7 @@ namespace OCA\Theming\Tests\Controller;
use OCA\Theming\Controller\ThemingController;
use OCA\Theming\Util;
+use OCP\App\IAppManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\Files\File;
@@ -57,18 +58,21 @@ class ThemingControllerTest extends TestCase {
private $rootFolder;
/** @var ITempManager */
private $tempManager;
+ /** @var IAppManager */
+ private $appManager;
public function setUp() {
$this->request = $this->getMockBuilder('OCP\IRequest')->getMock();
$this->config = $this->getMockBuilder('OCP\IConfig')->getMock();
$this->template = $this->getMockBuilder('OCA\Theming\ThemingDefaults')
->disableOriginalConstructor()->getMock();
- $this->util = new Util();
$this->timeFactory = $this->getMockBuilder('OCP\AppFramework\Utility\ITimeFactory')
->disableOriginalConstructor()
->getMock();
$this->l10n = $this->getMockBuilder('OCP\IL10N')->getMock();
$this->rootFolder = $this->getMockBuilder('OCP\Files\IRootFolder')->getMock();
+ $this->appManager = $this->getMockBuilder('OCP\App\IAppManager')->getMock();
+ $this->util = new Util($this->config, $this->rootFolder, $this->appManager);
$this->timeFactory->expects($this->any())
->method('getTime')
->willReturn(123);
@@ -484,6 +488,12 @@ class ThemingControllerTest extends TestCase {
$expectedData .= sprintf('.nc-theming-main-background {background-color: %s}' . "\n", $color);
$expectedData .= sprintf('.nc-theming-main-text {color: %s}' . "\n", $color);
$expectedData .= '.nc-theming-contrast {color: #ffffff}' . "\n";
+ $expectedData .= '.icon-file,.icon-filetype-text {' .
+ 'background-image: url(\'./img/core/filetypes/text.svg?v=0\');' . "}\n" .
+ '.icon-folder, .icon-filetype-folder {' .
+ 'background-image: url(\'./img/core/filetypes/folder.svg?v=0\');' . "}\n" .
+ '.icon-filetype-folder-drag-accept {' .
+ 'background-image: url(\'./img/core/filetypes/folder-drag-accept.svg?v=0\')!important;' . "}\n";
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
@@ -578,6 +588,12 @@ class ThemingControllerTest extends TestCase {
$expectedData .= '#body-login input.login { background-image: url(\'' . \OC::$WEBROOT . '/core/img/actions/confirm.svg?v=2\'); }' . "\n";
$expectedData .= '.nc-theming-contrast {color: #000000}' . "\n";
$expectedData .= '.ui-widget-header { color: #000000; }' . "\n";
+ $expectedData .= '.icon-file,.icon-filetype-text {' .
+ 'background-image: url(\'./img/core/filetypes/text.svg?v=0\');' . "}\n" .
+ '.icon-folder, .icon-filetype-folder {' .
+ 'background-image: url(\'./img/core/filetypes/folder.svg?v=0\');' . "}\n" .
+ '.icon-filetype-folder-drag-accept {' .
+ 'background-image: url(\'./img/core/filetypes/folder-drag-accept.svg?v=0\')!important;' . "}\n";
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
@@ -623,6 +639,12 @@ class ThemingControllerTest extends TestCase {
'background-size: contain;' .
'}' . "\n";
$expectedData .= '.nc-theming-contrast {color: #ffffff}' . "\n";
+ $expectedData .= '.icon-file,.icon-filetype-text {' .
+ 'background-image: url(\'./img/core/filetypes/text.svg?v=0\');' . "}\n" .
+ '.icon-folder, .icon-filetype-folder {' .
+ 'background-image: url(\'./img/core/filetypes/folder.svg?v=0\');' . "}\n" .
+ '.icon-filetype-folder-drag-accept {' .
+ 'background-image: url(\'./img/core/filetypes/folder-drag-accept.svg?v=0\')!important;' . "}\n";
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
@@ -765,6 +787,12 @@ class ThemingControllerTest extends TestCase {
'background-image: url(\'./loginbackground?v=0\');' .
'}' . "\n";
$expectedData .= '.nc-theming-contrast {color: #ffffff}' . "\n";
+ $expectedData .= '.icon-file,.icon-filetype-text {' .
+ 'background-image: url(\'./img/core/filetypes/text.svg?v=0\');' . "}\n" .
+ '.icon-folder, .icon-filetype-folder {' .
+ 'background-image: url(\'./img/core/filetypes/folder.svg?v=0\');' . "}\n" .
+ '.icon-filetype-folder-drag-accept {' .
+ 'background-image: url(\'./img/core/filetypes/folder-drag-accept.svg?v=0\')!important;' . "}\n";
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
$expected->cacheFor(3600);
@@ -876,6 +904,13 @@ class ThemingControllerTest extends TestCase {
$expectedData .= '#body-login input.login { background-image: url(\'' . \OC::$WEBROOT . '/core/img/actions/confirm.svg?v=2\'); }' . "\n";
$expectedData .= '.nc-theming-contrast {color: #000000}' . "\n";
$expectedData .= '.ui-widget-header { color: #000000; }' . "\n";
+ $expectedData .= '.icon-file,.icon-filetype-text {' .
+ 'background-image: url(\'./img/core/filetypes/text.svg?v=0\');' . "}\n" .
+ '.icon-folder, .icon-filetype-folder {' .
+ 'background-image: url(\'./img/core/filetypes/folder.svg?v=0\');' . "}\n" .
+ '.icon-filetype-folder-drag-accept {' .
+ 'background-image: url(\'./img/core/filetypes/folder-drag-accept.svg?v=0\')!important;' . "}\n";
+ $expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
$expected->cacheFor(3600);
@@ -910,6 +945,7 @@ class ThemingControllerTest extends TestCase {
slogan: "",
color: "#000",
inverted: false,
+ cacheBuster: null
};
})();';
$expected = new Http\DataDisplayResponse($expectedResponse);
@@ -944,6 +980,7 @@ class ThemingControllerTest extends TestCase {
slogan: "awesome",
color: "#ffffff",
inverted: true,
+ cacheBuster: null
};
})();';
$expected = new Http\DataDisplayResponse($expectedResponse);