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

testCanMergeAnArrayIntoAnObject() public method

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