* @license PHP License * @package WB * @subpackage unittest */ /** * Unit Test * * TestBaseClass * * @version 0.1.0 * @package WB * @subpackage unittest */ class TestCaseBase_ConfigXInc extends UnitTestCase { /** * config loader * @var WBConfig */ private $config; /** * config unserializer * @var WBConfig_Unserializer */ private $unser; /** * config serializer * @var WBConfig_Serializer */ private $ser; public function __construct() { WBClass::load('WBUnitTest_SQLUte'); //WBUnitTest_SQLUte::source( __FILE__, 'construct' ); $this->config = WBClass::create('WBConfig'); } /** * destruct * * Remove testing tables */ public function __destruct() { //WBUnitTest_SQLUte::source( __FILE__, 'destruct' ); } public function testClassLoading() { WBClass::load('WBConfig'); $this->assertTrue(class_exists('WBConfig', false)); $this->assertIsA($this->config, 'WBConfig'); } public function testXInc() { $this->config->setLoader('File'); $this->config->load('unittest/xinc'); $ex = $this->config->get('example'); $this->assertEqual(count($ex), 5); $this->assertEqual(count($ex['list']), 5); $this->assertEqual('first', $ex['list'][0]); $this->assertEqual('second', $ex['list'][1]); $this->assertEqual('third', $ex['list'][2]); $this->assertEqual('list-first', $ex['list'][3]); $this->assertEqual('list-second', $ex['list'][4]); $this->assertEqual(count($ex['more']), 4); $this->assertEqual('list-first', $ex['more'][0]); $this->assertEqual('list-second', $ex['more'][1]); $this->assertEqual('more-first', $ex['more'][2]); $this->assertEqual('more-second', $ex['more'][3]); } }