DataSift\Storyplayer\ConfigLib\WrappedConfigTest::testCanMergeIntoTopLevel PHP Method

testCanMergeIntoTopLevel() public method

    public function testCanMergeIntoTopLevel()
    {
        // ----------------------------------------------------------------
        // setup your test
        $obj = new WrappedConfig();
        $obj->loadConfigFromFile(__DIR__ . "/wrapped-config-2.json");
        $dataToMerge = new stdClass();
        $dataToMerge->home = getenv("HOME");
        // ----------------------------------------------------------------
        // perform the change
        $obj->mergeData("", $dataToMerge);
        // ----------------------------------------------------------------
        // test the results
        $config = $obj->getConfig();
        // this is the data we have merged
        $this->assertEquals(getenv("HOME"), $config->home);
        // this is data loaded from the config file
        $this->assertTrue(isset($config->storyplayer));
    }
WrappedConfigTest