mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 20:27:07 +09:00
* Fix PATH_DATA constant to use config Update `PATH_DATA` constant to use the `path_data` config option. * Replace direct config references with constants Replace direct references to `config.php` file and specific config options in favour of global constants, where available. * Drop BB prefix on global constants Rename global constants to drop `BB_` prefix, where appropriate.
95 lines
2.8 KiB
PHP
95 lines
2.8 KiB
PHP
<?php
|
|
/**
|
|
* @group Core
|
|
*/
|
|
class Box_Mod_Theme_ServiceTest extends BBDbApiTestCase
|
|
{
|
|
|
|
public function testgetCurrentThemePreset()
|
|
{
|
|
$service = new \Box\Mod\Theme\Service();
|
|
$service->setDi($this->di);
|
|
$themeModel = $service->getTheme('huraga');
|
|
$result = $service->getCurrentThemePreset($themeModel);
|
|
$this->assertIsString($result);
|
|
$this->assertNotEmpty($result);
|
|
}
|
|
|
|
public function testgetThemePresets()
|
|
{
|
|
$service = new \Box\Mod\Theme\Service();
|
|
$service->setDi($this->di);
|
|
$themeModel = $service->getTheme('huraga');
|
|
$result = $service->getThemePresets($themeModel);
|
|
$this->assertIsArray($result);
|
|
$this->assertNotEmpty($result);
|
|
}
|
|
|
|
public function testgetThemeSettings()
|
|
{
|
|
$service = new \Box\Mod\Theme\Service();
|
|
$service->setDi($this->di);
|
|
$themeModel = $service->getTheme('huraga');
|
|
$result = $service->getThemeSettings($themeModel);
|
|
$this->assertIsArray($result);
|
|
}
|
|
|
|
public function testupdateSettings()
|
|
{
|
|
$service = new \Box\Mod\Theme\Service();
|
|
$service->setDi($this->di);
|
|
|
|
$themeModel = $service->getTheme('huraga');
|
|
|
|
$preset = 'phpUnit';
|
|
$params = array();
|
|
|
|
$result = $service->updateSettings($themeModel, $preset, $params);
|
|
$this->assertTrue($result);
|
|
}
|
|
|
|
public function testregenerateThemeSettingsDataFile()
|
|
{
|
|
$service = new \Box\Mod\Theme\Service();
|
|
$service->setDi($this->di);
|
|
|
|
$themeModel = $service->getTheme('huraga');
|
|
|
|
$result = $service->regenerateThemeSettingsDataFile($themeModel);
|
|
$this->assertTrue($result);
|
|
}
|
|
|
|
public function testregenerateThemeCssAndJsFiles()
|
|
{
|
|
$service = new \Box\Mod\Theme\Service();
|
|
$service->setDi($this->di);
|
|
|
|
$themeModel = $service->getTheme('huraga');
|
|
|
|
$preset = 'phpUnit';
|
|
$result = $service->regenerateThemeCssAndJsFiles($themeModel, $preset, $this->di['api_admin']);
|
|
$this->assertTrue($result);
|
|
}
|
|
|
|
public function testgetCurrentAdminAreaTheme()
|
|
{
|
|
$service = new \Box\Mod\Theme\Service();
|
|
$service->setDi($this->di);
|
|
|
|
$result = $service->getCurrentAdminAreaTheme();
|
|
$this->assertIsArray($result);
|
|
$this->assertEquals('admin_default', $result['code']);
|
|
$this->assertEquals(SYSTEM_URL . 'themes/admin_default/', $result['url']);
|
|
}
|
|
|
|
public function testgetCurrentClientAreaTheme()
|
|
{
|
|
$service = new \Box\Mod\Theme\Service();
|
|
$service->setDi($this->di);
|
|
|
|
$result = $service->getCurrentClientAreaTheme();
|
|
$this->assertInstanceOf('\Box\Mod\Theme\Model\Theme', $result);
|
|
$this->assertEquals('huraga', $result->getName());
|
|
}
|
|
}
|