Author: Stuart Herbert (stuart.herbert@datasift.com)
 public function __construct()
 {
     parent::__construct('DataSift\\Storyplayer\\DeviceLib\\DeviceConfig');
     $this->initDefaultConfig();
 }
 public function __construct()
 {
     parent::__construct('DataSift\\Storyplayer\\SystemsUnderTestLib\\SystemUnderTestConfig');
     $this->initDefaultConfig();
 }
 /**
  * @covers DataSift\Storyplayer\ConfigLib\ConfigList::__construct
  * @covers DataSift\Storyplayer\ConfigLib\ConfigList::addHardCodedList
  */
 public function testCanAddEntriesFromAHardCodedList()
 {
     // ----------------------------------------------------------------
     // setup your test
     $obj = new ConfigList("DataSift\\Storyplayer\\ConfigLib\\WrappedConfig", __DIR__ . '/ConfigListTestData1');
     $hardCodedList = new HardCodedList('DataSift\\Storyplayer\\ConfigLib\\WrappedConfig');
     $expected1 = $hardCodedList->newConfig('hard-coded-config-1');
     $expected1->getConfig()->name = 'config-1';
     $expected2 = $hardCodedList->newConfig('hard-coded-config-2');
     $expected2->getConfig()->name = 'config-2';
     // ----------------------------------------------------------------
     // perform the change
     $obj->addHardCodedList($hardCodedList);
     // ----------------------------------------------------------------
     // test the results
     $this->assertTrue($obj->hasEntry('hard-coded-config-1'));
     $this->assertSame($expected1, $obj->getEntry('hard-coded-config-1'));
     $this->assertTrue($obj->hasEntry('hard-coded-config-2'));
     $this->assertSame($expected2, $obj->getEntry('hard-coded-config-2'));
 }
 public function __construct()
 {
     parent::__construct('DataSift\\Storyplayer\\TestEnvironmentsLib\\TestEnvironmentConfig');
     $this->initDefaultConfig();
 }
 /**
  * @covers DataSift\Storyplayer\ConfigLib\HardCodedList::__construct
  * @covers DataSift\Storyplayer\ConfigLib\HardCodedList::addConfig
  * @expectedException DataSift\Storyplayer\ConfigLib\E4xx_IncompatibleConfigClass
  */
 public function testCanAddedConfigsMustBeCompatibleType()
 {
     // ----------------------------------------------------------------
     // setup the test
     $expectedName = 'test-config';
     $obj = new HardCodedList('DataSift\\Storyplayer\\ConfigLib\\StoryplayerConfig');
     // ----------------------------------------------------------------
     // perform the change
     $config = new WrappedConfig();
     $config->setName($expectedName);
     $obj->addConfig($config);
 }
Exemple #6
0
 /**
  * add config entries from a hard-coded list
  *
  * @param HardCodedList $hardCodedDefaults
  *        the entries to add
  */
 public function addHardCodedList(HardCodedList $hardCodedDefaults)
 {
     $list = $hardCodedDefaults->getConfigs();
     foreach ($list as $name => $config) {
         $this->addEntry($name, $config);
     }
 }