From 8c0f19c7971e1a4534347ce9d6d82a0a45799711 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Mon, 3 Dec 2018 00:46:04 +0100 Subject: namespacing: \Shaarli\Render\{PageBuilder,ThemeUtils} Signed-off-by: VirtualTam --- tests/render/ThemeUtilsTest.php | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tests/render/ThemeUtilsTest.php (limited to 'tests/render/ThemeUtilsTest.php') diff --git a/tests/render/ThemeUtilsTest.php b/tests/render/ThemeUtilsTest.php new file mode 100644 index 00000000..6159a1bd --- /dev/null +++ b/tests/render/ThemeUtilsTest.php @@ -0,0 +1,55 @@ +assertTrue(in_array($theme, $themes)); + } + $this->assertFalse(in_array('supertheme', $res)); + + foreach ($themes as $theme) { + rmdir('sandbox/tpl/'. $theme); + } + unlink('sandbox/tpl/supertheme'); + rmdir('sandbox/tpl'); + } + + /** + * Test getThemes() without any theme dir. + */ + public function testGetThemesEmpty() + { + mkdir('sandbox/tpl/', 0755, true); + $this->assertEquals([], ThemeUtils::getThemes('sandbox/tpl/')); + rmdir('sandbox/tpl/'); + } + + /** + * Test getThemes() with an invalid path. + */ + public function testGetThemesInvalid() + { + $this->assertEquals([], ThemeUtils::getThemes('nope')); + } +} -- cgit v1.2.3 From dea72c711ff740b3b829d238fcf85648465143a0 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sat, 12 Jan 2019 23:55:38 +0100 Subject: Optimize and cleanup imports Signed-off-by: VirtualTam --- tests/render/ThemeUtilsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/render/ThemeUtilsTest.php') diff --git a/tests/render/ThemeUtilsTest.php b/tests/render/ThemeUtilsTest.php index 6159a1bd..58e3426b 100644 --- a/tests/render/ThemeUtilsTest.php +++ b/tests/render/ThemeUtilsTest.php @@ -7,7 +7,7 @@ namespace Shaarli\Render; * * @package Shaarli */ -class ThemeUtilsTest extends \PHPUnit_Framework_TestCase +class ThemeUtilsTest extends \PHPUnit\Framework\TestCase { /** * Test getThemes() with existing theme directories. -- cgit v1.2.3