$fixtures =
new Fixtures();
$destination =
$fixtures->
destinationPath('[web-root]/robots.txt'
);
$options = ScaffoldOptions::
create([]);
// Assert that there is no target file before we run our test.
$this->
assertFileDoesNotExist($destination->
fullPath());
// Create a file.
file_put_contents($destination->
fullPath(), "# This is a test\n"
);
$prepend =
$fixtures->
sourcePath('drupal-drupal-test-append', 'prepend-to-robots.txt'
);
$append =
$fixtures->
sourcePath('drupal-drupal-test-append', 'append-to-robots.txt'
);
$sut =
new AppendOp($prepend,
$append, TRUE
);
$sut->
scaffoldAtNewLocation($destination);
$expected = <<<EOT
# robots.txt fixture scaffolded from "file-mappings" in drupal-drupal-test-append composer.json fixture.
# This content is prepended to the top of the existing robots.txt fixture.
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# This is a test
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# This content is appended to the bottom of the existing robots.txt fixture.
# robots.txt fixture scaffolded from "file-mappings" in drupal-drupal-test-append composer.json fixture.