Neos\Flow\Tests\Unit\Configuration\Source\YamlSourceTest::saveDoesNotOverwriteExistingHeaderCommentsIfFileExists PHP Method

saveDoesNotOverwriteExistingHeaderCommentsIfFileExists() public method

    public function saveDoesNotOverwriteExistingHeaderCommentsIfFileExists()
    {
        $pathAndFilename = vfsStream::url('testDirectory') . '/YAMLConfiguration';
        $comment = '# This comment should stay' . chr(10) . 'Test: foo' . chr(10);
        file_put_contents($pathAndFilename . '.yaml', $comment);
        $configurationSource = new YamlSource();
        $configurationSource->save($pathAndFilename, ['configurationFileHasBeenLoaded' => true]);
        $yaml = file_get_contents($pathAndFilename . '.yaml');
        $this->assertContains('# This comment should stay' . chr(10) . chr(10), $yaml, 'Header comment was removed from file.');
        $this->assertNotContains('Test: foo', $yaml);
    }