Skip to content

Commit

Permalink
Fixed Composer resolving to an outdated version of drupal/coder. (#237
Browse files Browse the repository at this point in the history
)
  • Loading branch information
AlexSkrypnyk authored Nov 27, 2024
1 parent 1779869 commit 41dfb31
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .devtools/assemble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
39 changes: 39 additions & 0 deletions .scaffold/tests/bats/functional.assemble.bats
Original file line number Diff line number Diff line change
@@ -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"
}
1 change: 1 addition & 0 deletions composer.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

1 comment on commit 41dfb31

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.