mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-04 10:14:13 +08:00
Legacy handler Unit Test cleanup
This commit is contained in:
parent
b1b048a152
commit
1e6b530091
2 changed files with 23 additions and 8 deletions
|
@ -26,17 +26,20 @@ class AppStringsHandlerTest extends Unit
|
|||
$this->handler = new AppStringsHandler($projectDir, $legacyDir, $legacySessionName, $defaultSessionName);
|
||||
}
|
||||
|
||||
protected function _after()
|
||||
{
|
||||
}
|
||||
|
||||
// tests
|
||||
|
||||
/**
|
||||
* Test Invalid language handling in AppStringsHandler
|
||||
*/
|
||||
public function testInvalidLanguageCheck()
|
||||
{
|
||||
$this->expectException(ItemNotFoundException::class);
|
||||
$this->handler->getAppStrings('invalid_lang');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test default language retrieval in AppStringsHandler
|
||||
*/
|
||||
public function testDefaultLanguageKey()
|
||||
{
|
||||
$appStrings = $this->handler->getAppStrings('en_us');
|
||||
|
|
|
@ -41,23 +41,29 @@ class SystemConfigHandlerTest extends Unit
|
|||
$exposedSystemConfigs);
|
||||
}
|
||||
|
||||
protected function _after()
|
||||
{
|
||||
}
|
||||
|
||||
// tests
|
||||
|
||||
/**
|
||||
* Test empty config key handling in SystemConfigHandler
|
||||
*/
|
||||
public function testEmptySystemConfigKeyCheck()
|
||||
{
|
||||
$defaultLanguage = $this->handler->getSystemConfig('');
|
||||
static::assertNull($defaultLanguage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test invalid config key handling in SystemConfigHandler
|
||||
*/
|
||||
public function testInvalidExposedSystemConfigCheck()
|
||||
{
|
||||
$this->expectException(ItemNotFoundException::class);
|
||||
$this->handler->getSystemConfig('dbconfig');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test retrieval of first level system config in SystemConfigHandler
|
||||
*/
|
||||
public function testGetValidOneLevelSystemConfig()
|
||||
{
|
||||
$defaultLanguage = $this->handler->getSystemConfig('default_language');
|
||||
|
@ -67,6 +73,9 @@ class SystemConfigHandlerTest extends Unit
|
|||
static::assertEmpty($defaultLanguage->getItems());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test retrieval of second level deep system config in SystemConfigHandler
|
||||
*/
|
||||
public function testGetValidTwoLevelSystemConfig()
|
||||
{
|
||||
$defaultLanguage = $this->handler->getSystemConfig('passwordsetting');
|
||||
|
@ -85,6 +94,9 @@ class SystemConfigHandlerTest extends Unit
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test retrieval of third level deep system config in SystemConfigHandler
|
||||
*/
|
||||
public function testGetValidThreeLevelSystemConfig()
|
||||
{
|
||||
$defaultLanguage = $this->handler->getSystemConfig('search');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue