// Assert that the template name is in the project created
// from the template.
$this->
assertArrayHasKey($json['name'
],
$template_data);
} } /**
* @dataProvider provideTemplateCreateProject
*/
public function testTemplateCreateProject($project,
$package_dir,
$docroot_dir) { // Make a working COMPOSER_HOME directory for setting global composer config
$composer_home =
$this->
getWorkspaceDirectory() . '/composer-home';
mkdir($composer_home);
// Create an empty global composer.json file, just to avoid warnings.
file_put_contents("
$composer_home/composer.json", '{}'
);
// Disable packagist globally (but only in our own custom COMPOSER_HOME).
// It is necessary to do this globally rather than in our SUT composer.json
// in order to ensure that Packagist is disabled during the
// `composer create-project` command.
$this->
executeCommand("COMPOSER_HOME=
$composer_home composer config --no-interaction --global repo.packagist false"
);
$this->
assertCommandSuccessful();