Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #5024. Allow Symfony 5.4 and 6 #5025

Merged
merged 10 commits into from Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions .circleci/config.yml
Expand Up @@ -109,7 +109,7 @@ jobs:

# PHP 8 test with Drupal tip
# Determines whether a newer version of a dependency has broken Drush.
test_81_drupal94_highest:
test_81_drupal10_highest:
<<: *defaults
docker:
- image: wodby/php:latest
Expand All @@ -122,7 +122,9 @@ jobs:
- run: cp .docker/zz-php.ini /usr/local/etc/php/conf.d/
- run: php --version
- run: composer -n config platform.php --unset
- run: composer -n require --dev drupal/core-recommended:9.4.x-dev --no-update
- run: composer -n require --dev drupal/core-recommended:10.0.x-dev --no-update
# Bring it back when it is compatible with Drupal 10.
- run: composer -n remove drupal/semver_example --no-update --dev
- run: composer -n update
- run: mkdir -p /tmp/results
- run: composer -n lint
Expand All @@ -144,7 +146,7 @@ workflows:
<<: *requires
- test_74_drupal9_mysql:
<<: *requires
- test_81_drupal94_highest:
- test_81_drupal10_highest:
<<: *requires
- test_74_drupal9_sqlite:
<<: *requires
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Expand Up @@ -34,7 +34,7 @@
"ext-dom": "*",
"chi-teck/drupal-code-generator": "^2.3",
"composer/semver": "^1.4 || ^3",
"consolidation/annotated-command": "^4.4",
"consolidation/annotated-command": "^4.5",
"consolidation/config": "^1.2",
"consolidation/filter-via-dot-access-data": "^1",
"consolidation/robo": "^3",
Expand All @@ -46,19 +46,19 @@
"league/container": "^3.4",
"psr/log": "~1.0",
"psy/psysh": "~0.11",
"symfony/event-dispatcher": "^4.0",
"symfony/finder": "^4.0 || ^5",
"symfony/event-dispatcher": "^4.0 || ^5.0 || ^6.0",
"symfony/finder": "^4.0 || ^5 || ^6",
"symfony/polyfill-php80": "^1.23",
"symfony/var-dumper": "^4.0 || ^5.0",
"symfony/yaml": "^4.0",
"symfony/var-dumper": "^4.0 || ^5.0 || ^6.0",
"symfony/yaml": "^4.0 || ^5.0 || ^6.0",
"webflo/drupal-finder": "^1.2",
"webmozart/path-util": "^2.1.0"
},
"require-dev": {
"composer/installers": "^1.7",
"cweagans/composer-patches": "~1.0",
"david-garcia/phpwhois": "4.3.0",
"drupal/core-recommended": "^9",
"drupal/core-recommended": "^9 || ^10",
"drupal/semver_example": "2.2.0",
"phpunit/phpunit": ">=7.5.20",
"rector/rector": "^0.12",
Expand Down
42 changes: 21 additions & 21 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

@@ -1,7 +1,7 @@
name: Drush empty module
description: 'Drush empty module'
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^8 || ^9 || ^10
type: module
# Require for the sake of tests - simulate what packaging would do.
project: drush_empty_module
2 changes: 1 addition & 1 deletion tests/fixtures/modules/woot/composer.json
Expand Up @@ -14,7 +14,7 @@
"extra": {
"drush": {
"services": {
"drush.services.yml": "^9 || ^10"
"drush.services.yml": "^9 || ^10 || ^11"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/modules/woot/woot.info.yml
@@ -1,5 +1,5 @@
name: Woot
type: module
description: Woot Mightily.
core_version_requirement: ^9
core_version_requirement: ^9 || ^10
package: Other
5 changes: 5 additions & 0 deletions tests/integration/SecurityUpdatesTest.php
Expand Up @@ -2,6 +2,8 @@

namespace Unish;

use Composer\Semver\Semver;

/**
* Tests "pm:security" command.
* @group commands
Expand All @@ -14,6 +16,9 @@ class SecurityUpdatesTest extends UnishIntegrationTestCase
*/
public function testInsecureDrupalPackage()
{
if (Semver::satisfies(\Drupal::VERSION, '^10')) {
$this->markTestSkipped('drupal/semver_example not yet compatible.');
}
list($expected_package, $expected_version) = ['drupal/semver_example', '2.2.0'];
$this->drush('pm:security', [], ['format' => 'json'], self::EXIT_ERROR_WITH_CLARITY);
$this->assertStringContainsString('One or more of your dependencies has an outstanding security update.', $this->getErrorOutput());
Expand Down
9 changes: 8 additions & 1 deletion tests/unish/CreateEntityType.php
Expand Up @@ -15,10 +15,17 @@ public static function createContentEntity($testCase): void
'name' => 'Unish Article',
'machine_name' => 'unish_article',
'description' => 'A test module',
'package' => 'unish',
// See https://www.drupal.org/project/drupal/issues/3096609.
'package' => 'Testing',
'dependencies' => 'drupal:text',
];
$testCase->drush('generate', ['module'], ['verbose' => null, 'answer' => $answers, 'destination' => Path::join($testCase->webroot(), 'modules/contrib')], null, null, $testCase::EXIT_SUCCESS, null, ['SHELL_INTERACTIVE' => 1]);
// Currently needed for Drush 10.x tests. Harmless on other versions.
$path = Path::join($testCase->webroot(), 'modules/contrib/unish_article/unish_article.info.yml');
$contents = file_get_contents($path);
file_put_contents($path, str_replace('^8 || ^9', '^8 || ^9 || ^10', $contents));


// Create a content entity type and enable its module.
// Note that only the values below are used. The keys are for documentation.
$answers = [
Expand Down
2 changes: 1 addition & 1 deletion tests/unish/TestModuleHelperTrait.php
Expand Up @@ -33,7 +33,7 @@ public function setupModulesForTests(array $modules, $sourcePath)
$info_path = $targetDir . "/$module.info.yml";
$module_info = file_get_contents($info_path);
if (strpos($module_info, 'core_version_requirement') === false) {
$module_info = "core_version_requirement: ^8 || ^9\n$module_info";
$module_info = "core_version_requirement: ^8 || ^9 || ^10\n$module_info";
file_put_contents($info_path, $module_info);
}
}
Expand Down