Test theme rendering

Tested for both built in themes.

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-01-05 15:47:51 +01:00
parent d6546473c0
commit 65aecc8e9e
2 changed files with 35 additions and 1 deletions

View File

@ -39,6 +39,7 @@ class ThemeTest extends PMATestCase
$GLOBALS['text_dir'] = 'ltr';
include 'themes/pmahomme/layout.inc.php';
$GLOBALS['server'] = '99';
$GLOBALS['collation_connection'] = 'utf-8';
}
/**
@ -123,6 +124,39 @@ class ThemeTest extends PMATestCase
$this->assertNotNull($newTheme);
}
/**
* Test for Theme::loadCss
*
* @param $theme string Path to theme files
*
* @return void
*
* @dataProvider listThemes
*/
public function testLoadCss($theme)
{
$newTheme = Theme::load($theme);
ob_start();
$ret = $newTheme->loadCss();
$out = ob_get_contents();
ob_end_clean();
$this->assertTrue($ret);
$this->assertContains('FILE: navigation.css.php', $out);
}
/**
* Data provider for Theme::loadCss test
*
* @return array with theme paths
*/
public function listThemes()
{
return array(
array('./themes/original'),
array('./themes/pmahomme/'),
);
}
/**
* Test for Theme::load
*

View File

@ -7,7 +7,7 @@
*/
// unplanned execution path
if (! defined('PMA_MINIMUM_COMMON')) {
if (! defined('PMA_MINIMUM_COMMON') && ! defined('TESTSUITE')) {
exit();
}