diff --git a/.devtools/assemble.sh b/.devtools/assemble.sh index a23bff5..4bdb3ee 100755 --- a/.devtools/assemble.sh +++ b/.devtools/assemble.sh @@ -122,8 +122,6 @@ fi sed "${sed_opts[@]}" 's|\(.*"prefer-stable"\): \(.*\),.*|\1: '${drupal_version_prefer_stable}',|' "build/composer.json" grep 'prefer-stable' "build/composer.json" -pass "Drupal codebase created." - info "Merging configuration from composer.dev.json." php -r "echo json_encode(array_replace_recursive(json_decode(file_get_contents('composer.dev.json'), true),json_decode(file_get_contents('build/composer.json'), true)),JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);" >"build/composer2.json" && mv -f "build/composer2.json" "build/composer.json" diff --git a/.scaffold/tests/bats/functional.assemble.bats b/.scaffold/tests/bats/functional.assemble.bats new file mode 100644 index 0000000..97b6a9d --- /dev/null +++ b/.scaffold/tests/bats/functional.assemble.bats @@ -0,0 +1,39 @@ +#!/usr/bin/env bats + +load _helper + +export BATS_FIXTURE_EXPORT_CODEBASE_ENABLED=1 + +@test "Assemble: Drupal 11" { + run .devtools/assemble.sh + assert_success + + assert_output_contains "Initialising Drupal 11 site" + + assert_output_contains "ASSEMBLE COMPLETE" + assert_dir_exists "${BUILD_DIR}/build/vendor" + assert_file_exists "${BUILD_DIR}/build/composer.json" + assert_file_exists "${BUILD_DIR}/build/composer.lock" + + # @see https://github.com/composer/composer/issues/12215 + run composer --working-dir="${BUILD_DIR}/build" require --dev drupal/coder --with-all-dependencies --dry-run + assert_output_not_contains "Upgrading" +} + +@test "Assemble: Drupal 10" { + export DRUPAL_VERSION="10" + + run .devtools/assemble.sh + assert_success + + assert_output_contains "Initialising Drupal 10 site" + + assert_output_contains "ASSEMBLE COMPLETE" + assert_dir_exists "${BUILD_DIR}/build/vendor" + assert_file_exists "${BUILD_DIR}/build/composer.json" + assert_file_exists "${BUILD_DIR}/build/composer.lock" + + # @see https://github.com/composer/composer/issues/12215 + run composer --working-dir="${BUILD_DIR}/build" require --dev drupal/coder --with-all-dependencies --dry-run + assert_output_not_contains "Upgrading" +} diff --git a/composer.dev.json b/composer.dev.json index 84ae244..fbe3475 100644 --- a/composer.dev.json +++ b/composer.dev.json @@ -6,6 +6,7 @@ "palantirnet/drupal-rector": "^0.18", "phpcompatibility/php-compatibility": "^9.3", "phpmd/phpmd": "^2.15", + "phpstan/phpdoc-parser": "^1", "phpspec/prophecy-phpunit": "^2", "phpstan/extension-installer": "^1.3", "vincentlanglet/twig-cs-fixer": "^2.8"