parent::
tearDown();
} /**
* Tests to see if scaffold operation runs at the correct times.
*/
public function testComposerHooks() { $topLevelProjectDir = 'composer-hooks-fixture';
$sut =
$this->fixturesDir . '/' .
$topLevelProjectDir;
// First test: run composer install. This is the same as composer update
// since there is no lock file. Ensure that scaffold operation ran.
$this->
mustExec("composer install --no-ansi",
$sut);
$this->
assertScaffoldedFile($sut . '/sites/default/default.settings.php', FALSE, 'Test version of default.settings.php from drupal/core'
);
// Run composer required to add in the scaffold-override-fixture. This
// project is "allowed" in our main fixture project, but not required.
// We expect that requiring this library should re-scaffold, resulting
// in a changed default.settings.php file.
$stdout =
$this->
mustExec("composer require --no-ansi --no-interaction fixtures/drupal-assets-fixture:dev-main fixtures/scaffold-override-fixture:dev-main",
$sut);
$this->
assertScaffoldedFile($sut . '/sites/default/default.settings.php', FALSE, 'scaffolded from the scaffold-override-fixture'
);
// Make sure that the appropriate notice informing us that scaffolding
// is allowed was printed.
$this->
assertStringContainsString('Package fixtures/scaffold-override-fixture has scaffold operations, and is already allowed in the root-level composer.json file.',
$stdout);
// Delete one scaffold file, just for test purposes, then run