aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-10-25 11:57:27 +0200
committerJulius Härtl <jus@bitgrid.net>2018-10-25 12:16:10 +0200
commitd21ded67a70672cfa56a48051fa752b431118604 (patch)
tree5f29256f45dbb761f5cc1ea80dd7d9802114196b /tests
parent0b2ef7e60873fbb2036a85a934bf1af23ebb5bc9 (diff)
downloadnextcloud-server-d21ded67a70672cfa56a48051fa752b431118604.tar.gz
nextcloud-server-d21ded67a70672cfa56a48051fa752b431118604.zip
Keep list of icons in a separate file for use in the accessibility app
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/Core/Controller/SvgControllerTest.php4
-rw-r--r--tests/lib/Template/IconsCacherTest.php14
2 files changed, 10 insertions, 8 deletions
diff --git a/tests/Core/Controller/SvgControllerTest.php b/tests/Core/Controller/SvgControllerTest.php
index 7a31d02b90f..2cac635c896 100644
--- a/tests/Core/Controller/SvgControllerTest.php
+++ b/tests/Core/Controller/SvgControllerTest.php
@@ -26,6 +26,7 @@ namespace Tests\Core\Controller;
use OC\AppFramework\Http;
use OC\Core\Controller\SvgController;
+use OC\Template\IconsCacher;
use OCP\App\IAppManager;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IRequest;
@@ -89,7 +90,8 @@ class SvgControllerTest extends TestCase {
$request = $this->getMockBuilder(IRequest::class)->getMock();
$timeFactory = $this->getMockBuilder(ITimeFactory::class)->getMock();
$appManager = $this->getMockBuilder(IAppManager::class)->getMock();
- $this->svgController = new SvgController('core', $request, $timeFactory, $appManager);
+ $iconsCacher = $this->getMockBuilder(IconsCacher::class)->disableOriginalConstructor()->setMethods(['__construct'])->getMock();
+ $this->svgController = new SvgController('core', $request, $timeFactory, $appManager, $iconsCacher);
}
/**
diff --git a/tests/lib/Template/IconsCacherTest.php b/tests/lib/Template/IconsCacherTest.php
index d6a9908989c..33735e3a45e 100644
--- a/tests/lib/Template/IconsCacherTest.php
+++ b/tests/lib/Template/IconsCacherTest.php
@@ -104,7 +104,7 @@ class IconsCacherTest extends \Test\TestCase {
public function testSetIconsFromValidCss() {
$css = "
icon.test {
- --icon-test: url('/svg/core/actions/add/000?v=1');
+ --icon-test: url('/index.php/svg/core/actions/add/000?v=1');
background-image: var(--icon-test);
}
";
@@ -116,10 +116,10 @@ class IconsCacherTest extends \Test\TestCase {
";
$iconsFile = $this->createMock(ISimpleFile::class);
- $this->folder->expects($this->once())
+ $this->folder->expects($this->exactly(2))
->method('getFile')
->willReturn($iconsFile);
-
+
$actual = $this->iconsCacher->setIconsCss($css);
$this->assertEquals($expected, $actual);
}
@@ -127,7 +127,7 @@ class IconsCacherTest extends \Test\TestCase {
public function testSetIconsFromValidCssMultipleTimes() {
$css = "
icon.test {
- --icon-test: url('/svg/core/actions/add/000?v=1');
+ --icon-test: url('/index.php/svg/core/actions/add/000?v=1');
background-image: var(--icon-test);
}
";
@@ -139,14 +139,14 @@ class IconsCacherTest extends \Test\TestCase {
";
$iconsFile = $this->createMock(ISimpleFile::class);
- $this->folder->expects($this->exactly(3))
+ $this->folder->expects($this->exactly(6))
->method('getFile')
->willReturn($iconsFile);
-
+
$actual = $this->iconsCacher->setIconsCss($css);
$actual = $this->iconsCacher->setIconsCss($actual);
$actual = $this->iconsCacher->setIconsCss($actual);
$this->assertEquals($expected, $actual);
}
-} \ No newline at end of file
+}