mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-12 07:11:42 +09:00
Add configuration helper (consolidator) class and unit tests
This commit is contained in:
parent
a098685c29
commit
557d338427
2 changed files with 111 additions and 0 deletions
22
tests/unit/framework/helpers/ConfigHelperTest.php
Normal file
22
tests/unit/framework/helpers/ConfigHelperTest.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
use Rhymix\Framework\Helpers\ConfigHelper;
|
||||
|
||||
class ConfigHelperTest extends \Codeception\TestCase\Test
|
||||
{
|
||||
public function testConsolidate()
|
||||
{
|
||||
$member_config = getModel('module')->getModuleConfig('member');
|
||||
$consolidated = ConfigHelper::consolidate(array(
|
||||
'dbtype' => array('db.type', 'member:nosuchconfig'),
|
||||
'member' => array('no.such.config', 'member:enable_join'),
|
||||
'nosuch' => array('no.such.config', 'member:no.such.config.either'),
|
||||
'single' => 'member:identifier',
|
||||
));
|
||||
|
||||
$this->assertEquals(config('db.type'), $consolidated['dbtype']);
|
||||
$this->assertEquals($member_config->enable_join, $consolidated['member']);
|
||||
$this->assertNull($consolidated['nosuch']);
|
||||
$this->assertEquals($member_config->identifier, $consolidated['single']);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue