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

testThrowsExceptionWhenConfigFileNotFound() public method

    public function testThrowsExceptionWhenConfigFileNotFound()
    {
        // ----------------------------------------------------------------
        // setup your test
        $expectedConfig = new BaseObject();
        $expectedName = WrappedConfig::NO_NAME;
        $obj = new WrappedConfig();
        // ----------------------------------------------------------------
        // perform the change
        $caughtException = false;
        try {
            $obj->loadConfigFromFile(__DIR__ . "/wrapped-config-does-not-exist.json");
        } catch (E4xx_ConfigFileNotFound $e) {
            $caughtException = true;
        }
        // ----------------------------------------------------------------
        // test the results
        $this->assertTrue($caughtException);
        // make sure the rest of the object has been left alone
        $actualConfig = $obj->getConfig();
        $actualName = $obj->getName();
        $this->assertEquals($expectedConfig, $actualConfig);
        $this->assertEquals($expectedName, $actualName);
    }
WrappedConfigTest