From d31c8960f804de45d44b96c8fd4cbdb7453c87be Mon Sep 17 00:00:00 2001 From: onli Date: Mon, 25 Jul 2016 20:54:52 +0200 Subject: [PATCH] Add test for serendipity_getTemplateFile --- tests/README | 18 +++++++++++++++ tests/include/functionsConfigTest.php | 33 +++++++++++++++++++++++++++ tests/include/functionsTest.php | 1 + 3 files changed, 52 insertions(+) create mode 100644 tests/include/functionsConfigTest.php diff --git a/tests/README b/tests/README index 0d7496ee..06d02c56 100644 --- a/tests/README +++ b/tests/README @@ -1,3 +1,21 @@ +PHPUnit +======= + + 1. In tests/, download PHPUnit + + $ wget https://phar.phpunit.de/phpunit.phar + + +Running the Tests +================= + + + $ php phpunit.phar --configuration config.xml.dist --coverage-html report include/* + + + ---- + + PHPUnit and Selenium RC ======================= diff --git a/tests/include/functionsConfigTest.php b/tests/include/functionsConfigTest.php new file mode 100644 index 00000000..52f0a509 --- /dev/null +++ b/tests/include/functionsConfigTest.php @@ -0,0 +1,33 @@ +assertContains('next/index.tpl', serendipity_getTemplateFile('index.tpl')); + define('IN_serendipity_admin', true); + $this->assertContains('2k11/admin/index.tpl', serendipity_getTemplateFile('admin/index.tpl')); + $this->assertContains('next/index.tpl', serendipity_getTemplateFile('index.tpl', 'serendipityHTTPPath', true)); + } + + +} \ No newline at end of file diff --git a/tests/include/functionsTest.php b/tests/include/functionsTest.php index fd49b718..d20dd2cf 100644 --- a/tests/include/functionsTest.php +++ b/tests/include/functionsTest.php @@ -1,6 +1,7 @@