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

testCanSetDataInsideAnObject() public method

    public function testCanSetDataInsideAnObject()
    {
        // ----------------------------------------------------------------
        // setup your test
        $obj = new WrappedConfig();
        $obj->loadConfigFromFile(__DIR__ . "/wrapped-config-2.json");
        $this->assertTrue(is_object($obj->getConfig()->storyplayer->user));
        // ----------------------------------------------------------------
        // perform the change
        $obj->setData("storyplayer.user", getenv("HOME"));
        // ----------------------------------------------------------------
        // test the results
        $config = $obj->getConfig();
        $this->assertTrue($config instanceof BaseObject);
        $this->assertTrue($config->storyplayer instanceof BaseObject);
        $this->assertEquals(getenv("HOME"), $config->storyplayer->user);
    }
WrappedConfigTest