new tests

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-07-24 12:21:07 +02:00
parent 6bcfe8d628
commit f62d4d174d
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
1 changed files with 27 additions and 2 deletions

View File

@ -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);
}
}