getExpandedConfig() public method

expand any variables in $this
public getExpandedConfig ( array | object | null $baseConfig = null ) : array | object
$baseConfig array | object | null the config to use for expanding variables (optional)
return array | object a copy of the config stored in $this, with any Twig variables expanded
 /**
  * @covers DataSift\Storyplayer\ConfigLib\WrappedConfig::getExpandedConfig()
  */
 public function testCanExpandTwigVariables()
 {
     // ----------------------------------------------------------------
     // setup your test
     // we need a config that contains a variable
     $obj = new WrappedConfig();
     $obj->loadConfigFromFile(__DIR__ . "/wrapped-config-2.json");
     $obj->setData("storyplayer.user.home", getenv("HOME"));
     $obj->setData("storyplayer.test.home", "{{storyplayer.user.home}}");
     // ----------------------------------------------------------------
     // perform the change
     $config = $obj->getExpandedConfig();
     // ----------------------------------------------------------------
     // test the results
     $this->assertEquals(getenv("HOME"), $config->storyplayer->test->home);
 }