diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-24 12:21:07 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-24 12:21:07 +0200 |
commit | f62d4d174db5f1a887cf50b9a13e57056a1d27a1 (patch) | |
tree | 6bdabe7b6c3e0558e3e64e2c54c632136e2fce92 /tests | |
parent | 6bcfe8d628004ae6da703d8e513088d6247dfb18 (diff) | |
download | nextcloud-server-f62d4d174db5f1a887cf50b9a13e57056a1d27a1.tar.gz nextcloud-server-f62d4d174db5f1a887cf50b9a13e57056a1d27a1.zip |
new tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Template/IconsCacherTest.php | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/lib/Template/IconsCacherTest.php b/tests/lib/Template/IconsCacherTest.php index 106f08d5fa8..d02f5b3f05f 100644 --- a/tests/lib/Template/IconsCacherTest.php +++ b/tests/lib/Template/IconsCacherTest.php @@ -80,7 +80,7 @@ class IconsCacherTest extends \Test\TestCase { public function testGetIconsFromValidCss() { $css = " icon.test { - --icon-test: url('/svg/core/actions/add/000'); + --icon-test: url('/svg/core/actions/add/000?v=1'); background-image: var(--icon-test); } "; @@ -104,7 +104,7 @@ class IconsCacherTest extends \Test\TestCase { public function testSetIconsFromValidCss() { $css = " icon.test { - --icon-test: url('/svg/core/actions/add/000'); + --icon-test: url('/svg/core/actions/add/000?v=1'); background-image: var(--icon-test); } "; @@ -124,4 +124,29 @@ class IconsCacherTest extends \Test\TestCase { $this->assertEquals($expected, $actual); } + public function testSetIconsFromValidCssMultipleTimes() { + $css = " + icon.test { + --icon-test: url('/svg/core/actions/add/000?v=1'); + background-image: var(--icon-test); + } + "; + $expected = " + icon.test { + + background-image: var(--icon-test); + } + "; + + $iconsFile = $this->createMock(ISimpleFile::class); + $this->folder->expects($this->exactly(3)) + ->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 |