function ComposerProjectTemplatesTest::makeTestPackage
Same name in other branches
- 9 core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php \Drupal\BuildTests\Composer\Template\ComposerProjectTemplatesTest::makeTestPackage()
- 8.9.x core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php \Drupal\BuildTests\Composer\Template\ComposerProjectTemplatesTest::makeTestPackage()
- 11.x core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php \Drupal\BuildTests\Composer\Template\ComposerProjectTemplatesTest::makeTestPackage()
Creates a test package that points to the templates.
Parameters
string $repository_path: The path where to create the test package.
string $version: The version under test.
1 call to ComposerProjectTemplatesTest::makeTestPackage()
- ComposerProjectTemplatesTest::testTemplateCreateProject in core/
tests/ Drupal/ BuildTests/ Composer/ Template/ ComposerProjectTemplatesTest.php - @dataProvider provideTemplateCreateProject
File
-
core/
tests/ Drupal/ BuildTests/ Composer/ Template/ ComposerProjectTemplatesTest.php, line 313
Class
- ComposerProjectTemplatesTest
- Demonstrate that Composer project templates can be built as patched.
Namespace
Drupal\BuildTests\Composer\TemplateCode
protected function makeTestPackage($repository_path, $version) {
$json = <<<JSON
{
"packages": {
"drupal/recommended-project": {
"{<span class="php-variable">$version</span>}": {
"name": "drupal/recommended-project",
"dist": {
"type": "path",
"url": "composer/Template/RecommendedProject"
},
"type": "project",
"version": "{<span class="php-variable">$version</span>}"
}
},
"drupal/legacy-project": {
"{<span class="php-variable">$version</span>}": {
"name": "drupal/legacy-project",
"dist": {
"type": "path",
"url": "composer/Template/LegacyProject"
},
"type": "project",
"version": "{<span class="php-variable">$version</span>}"
}
}
}
}
JSON;
mkdir(dirname($repository_path));
file_put_contents($repository_path, $json);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.