diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-01-03 12:01:25 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-01-05 16:16:27 +0100 |
commit | 04a0e8ea34c241fdf6bd30b11f5242656f9cd1c2 (patch) | |
tree | 20c99e86f3fc862f90d3d7475f4a49b89557a7d4 /tests/ApplicationUtilsTest.php | |
parent | a0df06517bada0f811b464017ce385290e02c2bf (diff) | |
download | Shaarli-04a0e8ea34c241fdf6bd30b11f5242656f9cd1c2.tar.gz Shaarli-04a0e8ea34c241fdf6bd30b11f5242656f9cd1c2.tar.zst Shaarli-04a0e8ea34c241fdf6bd30b11f5242656f9cd1c2.zip |
Updater: keep custom theme preference with the new theme setting
Diffstat (limited to 'tests/ApplicationUtilsTest.php')
-rw-r--r-- | tests/ApplicationUtilsTest.php | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/tests/ApplicationUtilsTest.php b/tests/ApplicationUtilsTest.php index c39649e8..634bd0ed 100644 --- a/tests/ApplicationUtilsTest.php +++ b/tests/ApplicationUtilsTest.php | |||
@@ -331,48 +331,4 @@ class ApplicationUtilsTest extends PHPUnit_Framework_TestCase | |||
331 | ApplicationUtils::checkResourcePermissions($conf) | 331 | ApplicationUtils::checkResourcePermissions($conf) |
332 | ); | 332 | ); |
333 | } | 333 | } |
334 | |||
335 | /** | ||
336 | * Test getThemes() with existing theme directories. | ||
337 | */ | ||
338 | public function testGetThemes() | ||
339 | { | ||
340 | $themes = ['theme1', 'default', 'Bl1p_- bL0p']; | ||
341 | foreach ($themes as $theme) { | ||
342 | mkdir('sandbox/tpl/'. $theme, 0777, true); | ||
343 | } | ||
344 | |||
345 | // include a file which should be ignored | ||
346 | touch('sandbox/tpl/supertheme'); | ||
347 | |||
348 | $res = ApplicationUtils::getThemes('sandbox/tpl/'); | ||
349 | foreach ($res as $theme) { | ||
350 | $this->assertTrue(in_array($theme, $themes)); | ||
351 | } | ||
352 | $this->assertFalse(in_array('supertheme', $res)); | ||
353 | |||
354 | foreach ($themes as $theme) { | ||
355 | rmdir('sandbox/tpl/'. $theme); | ||
356 | } | ||
357 | unlink('sandbox/tpl/supertheme'); | ||
358 | rmdir('sandbox/tpl'); | ||
359 | } | ||
360 | |||
361 | /** | ||
362 | * Test getThemes() without any theme dir. | ||
363 | */ | ||
364 | public function testGetThemesEmpty() | ||
365 | { | ||
366 | mkdir('sandbox/tpl/', 0777, true); | ||
367 | $this->assertEquals([], ApplicationUtils::getThemes('sandbox/tpl/')); | ||
368 | rmdir('sandbox/tpl/'); | ||
369 | } | ||
370 | |||
371 | /** | ||
372 | * Test getThemes() with an invalid path. | ||
373 | */ | ||
374 | public function testGetThemesInvalid() | ||
375 | { | ||
376 | $this->assertEquals([], ApplicationUtils::getThemes('nope')); | ||
377 | } | ||
378 | } | 334 | } |