Gush\Tests\ConfigFactoryTest::testDumpConfigToLocalFile PHP Метод

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

    public function testDumpConfigToLocalFile()
    {
        $localDir = $this->getNewTmpDirectory('gush-local');
        $config = ConfigFactory::createConfig($localDir);
        $config->merge(['adapter' => 'bitbucket'], Config::CONFIG_LOCAL);
        $this->assertFileNotExists($localDir . '/.gush.yml');
        ConfigFactory::dumpToFile($config, Config::CONFIG_LOCAL);
        ConfigFactory::dumpToFile($config, Config::CONFIG_SYSTEM);
        $this->assertFileExists($localDir . '/.gush.yml');
        $this->assertEquals(['adapter' => 'bitbucket'], Yaml::parse(file_get_contents($localDir . '/.gush.yml')));
        ConfigFactory::dumpToFile($config, Config::CONFIG_SYSTEM);
        $this->assertFileExists($this->homedir . '/.gush.yml');
        $this->assertEquals(['adapters' => []], Yaml::parse(file_get_contents($this->homedir . '/.gush.yml')));
    }