Legacy handler Unit Test cleanup

This commit is contained in:
Clemente Raposo 2020-03-13 11:59:52 +00:00 committed by Dillon-Brown
parent b1b048a152
commit 1e6b530091
2 changed files with 23 additions and 8 deletions

View file

@ -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');

View file

@ -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');