DataSift\Storyplayer\ConfigLib\ConfigList::newWrappedConfigObject PHP Метод

newWrappedConfigObject() публичный Метод

returns a object of the correct type for the content we are listing
public newWrappedConfigObject ( ) : object
Результат object
    public function newWrappedConfigObject()
    {
        $classname = $this->getWrappedConfigClassname();
        $obj = new $classname();
        return $obj;
    }

Usage Example

Пример #1
0
 /**
  * @covers DataSift\Storyplayer\ConfigLib\ConfigList::__construct
  * @covers DataSift\Storyplayer\ConfigLib\ConfigList::getConfigType
  * @covers DataSift\Storyplayer\ConfigLib\ConfigList::setConfigType
  * @covers DataSift\Storyplayer\ConfigLib\ConfigList::getWrappedConfigClassname
  * @covers DataSift\Storyplayer\ConfigLib\ConfigList::newWrappedConfigObject
  */
 public function testCanGetNewListedConfigObject()
 {
     // ----------------------------------------------------------------
     // setup the test
     $expectedClassname = "DataSift\\Storyplayer\\ConfigLib\\WrappedConfig";
     // ----------------------------------------------------------------
     // perform the change
     $obj = new ConfigList($expectedClassname, __DIR__ . '/ConfigListTestData1');
     // ----------------------------------------------------------------
     // test the results
     $actualClassname = $obj->getWrappedConfigClassname();
     $this->assertEquals($expectedClassname, $actualClassname);
     $actualConfigObj = $obj->newWrappedConfigObject();
     $this->assertTrue($actualConfigObj instanceof WrappedConfig);
 }