DataSift\Storyplayer\ConfigLib\WrappedConfigTest::testCanReplaceTopLevelUsingSetData PHP Метод

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

    public function testCanReplaceTopLevelUsingSetData()
    {
        // ----------------------------------------------------------------
        // 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("", getenv("HOME"));
        // ----------------------------------------------------------------
        // test the results
        $config = $obj->getConfig();
        $this->assertTrue(is_string($config));
        $this->assertEquals(getenv("HOME"), $config);
    }
WrappedConfigTest