From e350b61466fe07658cfd5fdcfa77814654a2b3e7 Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Mon, 9 Mar 2020 15:21:02 -0400 Subject: [PATCH 1/5] Back to dev. --- config/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/VERSION b/config/VERSION index c7cd5b267..3d6269b0f 100644 --- a/config/VERSION +++ b/config/VERSION @@ -1 +1 @@ -v1.2.4 +v1.2.4-dev From 331a886c99f9e6b01b2cb1ecac06fba0ff88ec2c Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Tue, 10 Mar 2020 07:27:43 -0700 Subject: [PATCH 2/5] Removed Drupal Console for compatibility with Drupal 9. (#66) --- docs/README.md | 4 ++-- src/Fixture/FixtureCreator.php | 7 ------- src/Fixture/FixtureInspector.php | 4 ---- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/docs/README.md b/docs/README.md index 9ae2e7cb2..b2295fe4d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -12,8 +12,8 @@ ORCA (Official Representative Customer Application) is a tool for testing a comp | --- | --- | | Adds all company packages to a BLT project via Composer, installs them and their subextensions, and runs their automated tests. | Ensures that all company packages can be added to the same codebase via Composer (prevents dependency conflicts), that there are no adverse install time or functional interactions between them, and that they have no undeclared dependencies, and prevents regressions. | | Adds only the package under test to a BLT project via Composer, installs it and its subextensions, and runs its automated tests. | Ensures that the package under test has no undeclared dependencies on other company packages and functions correctly on its own. | -| Performs the above tests with the recommended, stable versions of company packages, Drush, and Drupal Console. | Ensures that the package under test still works with the versions of other software already released and in use and prevents releases of the package from disrupting the ecosystem. | -| Performs the above tests using the latest development versions of company packages, Drush, and Drupal Console. | Ensures that the package under test will continue to work when new versions of other software are released and prevents changes in the ecosystem from breaking the package. Forces early awareness and collaboration between project teams and prevents rework and release day emergency support situations. | +| Performs the above tests with the recommended, stable versions of company packages and Drush. | Ensures that the package under test still works with the versions of other software already released and in use and prevents releases of the package from disrupting the ecosystem. | +| Performs the above tests using the latest development versions of company packages and Drush. | Ensures that the package under test will continue to work when new versions of other software are released and prevents changes in the ecosystem from breaking the package. Forces early awareness and collaboration between project teams and prevents rework and release day emergency support situations. | | Performs the above tests using a threefold spread of Drupal core versions: the previous minor release, the current supported release, and the next minor dev version. | Ensures that the package under test still works with both supported releases of Drupal and will continue to work when the next one drops. | | Performs static analysis of the package under test. | Ensures low level construction quality. (Prevents PHP warnings and errors, version incompatibility, etc.) | diff --git a/src/Fixture/FixtureCreator.php b/src/Fixture/FixtureCreator.php index 36ce057e5..ba27717c1 100644 --- a/src/Fixture/FixtureCreator.php +++ b/src/Fixture/FixtureCreator.php @@ -414,13 +414,6 @@ private function fixDefaultDependencies(): void { $additions[] = 'drush/drush:dev-master || 10.x-dev || 9.x-dev || 9.5.x-dev'; } - // Add Drupal Console as a soft dependency akin to Drush. - $drupal_console_version = '~1.0'; - if ($this->isDev) { - $drupal_console_version = 'dev-master'; - } - $additions[] = "drupal/console:{$drupal_console_version}"; - // Install a specific version of Drupal core. if ($this->drupalCoreVersion) { $additions[] = "drupal/core:{$this->drupalCoreVersion}"; diff --git a/src/Fixture/FixtureInspector.php b/src/Fixture/FixtureInspector.php index de1311b06..11d5d9f9c 100644 --- a/src/Fixture/FixtureInspector.php +++ b/src/Fixture/FixtureInspector.php @@ -119,10 +119,6 @@ public function getOverview(): array { 'Drush version', $this->getInstalledPackageVersionPretty('drush/drush'), ]; - $overview[] = [ - 'Drupal Console version', - $this->getInstalledPackageVersionPretty('drupal/console'), - ]; $overview = array_merge($overview, $this->getInstalledPackages()); From 370511c9cebf069a90696f2d23435c4710e0d186 Mon Sep 17 00:00:00 2001 From: Travis Carden Date: Thu, 12 Mar 2020 11:17:59 -0400 Subject: [PATCH 3/5] Fixed `fixture:init --core` handling of version ranges. (#71) --- src/Fixture/FixtureCreator.php | 53 ++++++++++++++++++++++--- src/Utility/DrupalCoreVersionFinder.php | 48 +++++++++++----------- 2 files changed, 72 insertions(+), 29 deletions(-) diff --git a/src/Fixture/FixtureCreator.php b/src/Fixture/FixtureCreator.php index ba27717c1..0ae6d5cef 100644 --- a/src/Fixture/FixtureCreator.php +++ b/src/Fixture/FixtureCreator.php @@ -3,6 +3,7 @@ namespace Acquia\Orca\Fixture; use Acquia\Orca\Exception\OrcaException; +use Acquia\Orca\Utility\DrupalCoreVersionFinder; use Acquia\Orca\Utility\ProcessRunner; use Acquia\Orca\Utility\StatusTable; use Acquia\Orca\Utility\SutSettingsTrait; @@ -15,6 +16,8 @@ use Composer\Package\Version\VersionGuesser; use Composer\Package\Version\VersionSelector; use Composer\Repository\RepositoryFactory; +use Composer\Semver\Comparator; +use Composer\Semver\VersionParser; use Noodlehaus\Config; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Filesystem\Filesystem; @@ -35,6 +38,13 @@ class FixtureCreator { */ private $blt; + /** + * The Drupal core version finder. + * + * @var \Acquia\Orca\Utility\DrupalCoreVersionFinder + */ + private $coreVersionFinder; + /** * The Composer exit on patch failure flag. * @@ -182,9 +192,18 @@ class FixtureCreator { */ private $filesystem; + /** + * The Semver version parser. + * + * @var \Composer\Semver\VersionParser + */ + private $versionParser; + /** * Constructs an instance. * + * @param \Acquia\Orca\Utility\DrupalCoreVersionFinder $core_version_finder + * The Drupal core version finder. * @param \Symfony\Component\Filesystem\Filesystem $filesystem * The filesystem. * @param \Acquia\Orca\Fixture\Fixture $fixture @@ -205,9 +224,12 @@ class FixtureCreator { * The subextension manager. * @param \Composer\Package\Version\VersionGuesser $version_guesser * The Composer version guesser. + * @param \Composer\Semver\VersionParser $version_parser + * The Semver version parser. */ - public function __construct(Filesystem $filesystem, Fixture $fixture, FixtureConfigurator $fixture_configurator, FixtureInspector $fixture_inspector, SiteInstaller $site_installer, SymfonyStyle $output, ProcessRunner $process_runner, PackageManager $package_manager, SubextensionManager $subextension_manager, VersionGuesser $version_guesser) { + public function __construct(DrupalCoreVersionFinder $core_version_finder, Filesystem $filesystem, Fixture $fixture, FixtureConfigurator $fixture_configurator, FixtureInspector $fixture_inspector, SiteInstaller $site_installer, SymfonyStyle $output, ProcessRunner $process_runner, PackageManager $package_manager, SubextensionManager $subextension_manager, VersionGuesser $version_guesser, VersionParser $version_parser) { $this->blt = $package_manager->getBlt(); + $this->coreVersionFinder = $core_version_finder; $this->filesystem = $filesystem; $this->fixture = $fixture; $this->fixtureConfigurator = $fixture_configurator; @@ -218,6 +240,7 @@ public function __construct(Filesystem $filesystem, Fixture $fixture, FixtureCon $this->siteInstaller = $site_installer; $this->subextensionManager = $subextension_manager; $this->versionGuesser = $version_guesser; + $this->versionParser = $version_parser; } /** @@ -409,8 +432,8 @@ private function fixDefaultDependencies(): void { $additions = []; - // Install the dev version of Drush. if ($this->isDev) { + // Install the dev version of Drush. $additions[] = 'drush/drush:dev-master || 10.x-dev || 9.x-dev || 9.5.x-dev'; } @@ -419,9 +442,7 @@ private function fixDefaultDependencies(): void { $additions[] = "drupal/core:{$this->drupalCoreVersion}"; } - // Install Drupal core dev requirements for Drupal 8.8 and later. (Before - // that BLT required webflo/drupal-core-require-dev.) - if ((float) $this->drupalCoreVersion >= 8.8) { + if ($this->shouldRequireDrupalCoreDev()) { $additions[] = 'drupal/core-dev'; } @@ -444,6 +465,28 @@ private function fixDefaultDependencies(): void { $this->processRunner->runOrcaVendorBin($command, $fixture_path); } + /** + * Determines whether or not to require drupal/core-dev. + * + * Require it for Drupal 8.8 and later. (Before that BLT required + * webflo/drupal-core-require-dev, which it supersedes.) + * + * @return bool + * Returns TRUE if it should be required, or FALSE if not. + */ + private function shouldRequireDrupalCoreDev(): bool { + try { + // Get the version if it's concrete as opposed to a range. + $version = $this->versionParser->normalize($this->drupalCoreVersion); + } + catch (\UnexpectedValueException $e) { + // The requested Drupal core version is a range. Get the best match. + $minimum_stability = $this->isDev ? 'dev' : 'stable'; + $version = $this->coreVersionFinder->find($this->drupalCoreVersion, $minimum_stability); + } + return Comparator::greaterThanOrEqualTo($version, '8.8'); + } + /** * Gets the list of unwanted packages. * diff --git a/src/Utility/DrupalCoreVersionFinder.php b/src/Utility/DrupalCoreVersionFinder.php index 95b1fef2c..ab445667a 100644 --- a/src/Utility/DrupalCoreVersionFinder.php +++ b/src/Utility/DrupalCoreVersionFinder.php @@ -89,6 +89,27 @@ public function getPretty(DrupalCoreVersion $version): string { } } + /** + * Finds the Drupal core version matching the given criteria. + * + * @param string|null $target_package_version + * The target package version. + * @param string $minimum_stability + * The minimum stability. Available options (in order of stability) are + * dev, alpha, beta, RC, and stable. + * + * @return string + * The version string. + */ + public function find(string $target_package_version = NULL, string $minimum_stability = 'stable'): string { + $best_candidate = $this->getVersionSelector($minimum_stability) + ->findBestCandidate('drupal/core', $target_package_version); + if (!$best_candidate) { + throw new \RuntimeException(sprintf('No Drupal core version satisfies the given constraints: version=%s, minimum stability=%s', $target_package_version, $minimum_stability)); + } + return $best_candidate->getVersion(); + } + /** * Gets the latest release from the previous minor version. * @@ -101,7 +122,7 @@ private function getPreviousMinorRelease(): string { if ($this->previousMinorRelease) { return $this->previousMinorRelease; } - $this->previousMinorRelease = $this->getCoreVersion("<{$this->getCurrentMinorVersion()}"); + $this->previousMinorRelease = $this->find("<{$this->getCurrentMinorVersion()}"); return $this->previousMinorRelease; } @@ -130,7 +151,7 @@ private function getCurrentRecommendedRelease(): string { if ($this->currentRecommendedRelease) { return $this->currentRecommendedRelease; } - $this->currentRecommendedRelease = $this->getCoreVersion(); + $this->currentRecommendedRelease = $this->find(); return $this->currentRecommendedRelease; } @@ -158,7 +179,7 @@ private function getNextRelease(): string { if ($this->nextRelease) { return $this->nextRelease; } - $this->nextRelease = $this->getCoreVersion(">{$this->getCurrentRecommendedRelease()}", 'alpha'); + $this->nextRelease = $this->find(">{$this->getCurrentRecommendedRelease()}", 'alpha'); return $this->nextRelease; } @@ -175,27 +196,6 @@ private function getNextDevVersion(): string { return "{$previous_minor_version}.x-dev"; } - /** - * Gets the Drupal core version matching the given criteria. - * - * @param string|null $target_package_version - * The target package version. - * @param string $minimum_stability - * The minimum stability. Available options (in order of stability) are - * dev, alpha, beta, RC, and stable. - * - * @return string - * The version string. - */ - private function getCoreVersion(string $target_package_version = NULL, string $minimum_stability = 'stable'): string { - $best_candidate = $this->getVersionSelector($minimum_stability) - ->findBestCandidate('drupal/core', $target_package_version); - if (!$best_candidate) { - throw new \RuntimeException(sprintf('No Drupal core version satisfies the given constraints: version=%s, minimum stability=%s', $target_package_version, $minimum_stability)); - } - return $best_candidate->getVersion(); - } - /** * Gets a Composer version selector. * From e85fb12f7b8b6a66b31a0474f41de8533a57f9eb Mon Sep 17 00:00:00 2001 From: Travis Carden Date: Fri, 13 Mar 2020 13:16:56 -0400 Subject: [PATCH 4/5] Added dedicated D9 readiness job. (#72) --- .travis.yml | 3 ++ bin/travis/install.sh | 1 + example/.travis.yml | 3 ++ example/example.info.yml | 1 + src/Command/Debug/DebugPackagesCommand.php | 5 ++-- src/Enum/DrupalCoreVersion.php | 3 ++ src/Utility/DrupalCoreVersionFinder.php | 24 +++++++++++++-- .../Debug/DebugPackagesCommandTest.php | 30 +++++-------------- .../Fixture/FixtureInitCommandTest.php | 2 +- 9 files changed, 44 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index 98456efc6..01a859a4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,10 @@ jobs: - { name: "Isolated test w/ dev package versions", env: ORCA_JOB=ISOLATED_DEV } - { name: "Integrated test w/ dev package versions", env: ORCA_JOB=INTEGRATED_DEV } - { name: "Integrated test w/ dev package versions & next minor dev version of Drupal core", env: ORCA_JOB=CORE_NEXT } + - { name: "D9 readiness test", php: "7.3", env: ORCA_JOB=D9_READINESS } - { name: "Custom job", env: ORCA_JOB=CUSTOM ORCA_CUSTOM_FIXTURE_INIT_ARGS="--help" ORCA_CUSTOM_TESTS_RUN_ARGS="--help" } + allow_failures: + - { php: "7.3", env: ORCA_JOB=D9_READINESS } before_install: - ../orca/bin/travis/self-test/before_install.sh diff --git a/bin/travis/install.sh b/bin/travis/install.sh index 8b7531b2b..6eaeee104 100755 --- a/bin/travis/install.sh +++ b/bin/travis/install.sh @@ -22,5 +22,6 @@ case "$ORCA_JOB" in "ISOLATED_DEV") orca debug:packages CURRENT_DEV; eval "orca fixture:init -f --sut=$ORCA_SUT_NAME --sut-only --core=CURRENT_DEV --dev --profile=$ORCA_FIXTURE_PROFILE" ;; "INTEGRATED_DEV") orca debug:packages CURRENT_DEV; eval "orca fixture:init -f --sut=$ORCA_SUT_NAME --core=CURRENT_DEV --dev --profile=$ORCA_FIXTURE_PROFILE" ;; "CORE_NEXT") orca debug:packages NEXT_DEV; eval "orca fixture:init -f --sut=$ORCA_SUT_NAME --core=NEXT_DEV --dev --profile=$ORCA_FIXTURE_PROFILE" ;; + "D9_READINESS") orca debug:packages D9_READINESS; eval "orca fixture:init -f --sut=$ORCA_SUT_NAME --sut-only --core='~9' --dev --profile=$ORCA_FIXTURE_PROFILE" ;; "CUSTOM") eval "orca fixture:init -f --sut=$ORCA_SUT_NAME --profile=$ORCA_FIXTURE_PROFILE ${ORCA_CUSTOM_FIXTURE_INIT_ARGS:=}" ;; esac diff --git a/example/.travis.yml b/example/.travis.yml index 7a994b7b6..2505cbc7e 100644 --- a/example/.travis.yml +++ b/example/.travis.yml @@ -97,6 +97,7 @@ jobs: - { name: "Isolated test w/ dev package versions", env: ORCA_JOB=ISOLATED_DEV } - { name: "Integrated test w/ dev package versions", env: ORCA_JOB=INTEGRATED_DEV } - { name: "Integrated test w/ dev package versions & next minor dev version of Drupal core", env: ORCA_JOB=CORE_NEXT } + - { name: "D9 readiness test", php: "7.3", env: ORCA_JOB=D9_READINESS} # Custom testing needs involving only minor variations on the standard setup # can be achieved without custom scripting using the "CUSTOM" ORCA_JOB. # @see https://github.com/acquia/orca/blob/master/docs/advanced-usage.md#travis-ci-scripts @@ -109,6 +110,8 @@ jobs: - env: ORCA_JOB=ISOLATED_DEV - env: ORCA_JOB=INTEGRATED_DEV - env: ORCA_JOB=CORE_NEXT + # You may need to allow the D9 readiness job to fail in the short term. + - { php: "7.3", env: ORCA_JOB=D9_READINESS } # Install ORCA and prepare the environment. before_install: diff --git a/example/example.info.yml b/example/example.info.yml index ebe0bf802..7514f12ea 100644 --- a/example/example.info.yml +++ b/example/example.info.yml @@ -3,3 +3,4 @@ type: module description: "Provides an example module for testing and illustration purposes." package: Other core: 8.x +core_version_requirement: '^8 || ^9' diff --git a/src/Command/Debug/DebugPackagesCommand.php b/src/Command/Debug/DebugPackagesCommand.php index a4b8eb29a..29ce2bfba 100644 --- a/src/Command/Debug/DebugPackagesCommand.php +++ b/src/Command/Debug/DebugPackagesCommand.php @@ -105,6 +105,7 @@ public function execute(InputInterface $input, OutputInterface $output): int { } (new Table($output)) + ->setHeaderTitle("Drupal {$this->coreVersion}") ->setHeaders($this->getHeaders()) ->setRows($this->getRows()) ->render(); @@ -120,8 +121,8 @@ public function execute(InputInterface $input, OutputInterface $output): int { * @SuppressWarnings(PHPMD.StaticAccess) */ private function handleCoreArgument($argument): void { - if (is_null($argument)) { - return; + if ($argument === NULL) { + $argument = '*'; } if (!is_string($argument)) { diff --git a/src/Enum/DrupalCoreVersion.php b/src/Enum/DrupalCoreVersion.php index 97a64aebb..083572ef4 100644 --- a/src/Enum/DrupalCoreVersion.php +++ b/src/Enum/DrupalCoreVersion.php @@ -21,6 +21,8 @@ final class DrupalCoreVersion extends Enum { public const NEXT_DEV = 'NEXT_DEV'; + public const D9_READINESS = 'D9_READINESS'; + /** * Provides help text for commands that accept Drupal core version input. * @@ -35,6 +37,7 @@ public static function commandHelp() { sprintf('- %s: The current development version, e.g., "8.6.x-dev"', self::CURRENT_DEV), sprintf('- %s: The next release version if available, e.g., "8.7.0-beta2"', self::NEXT_RELEASE), sprintf('- %s: The next development version, e.g., "8.7.x-dev"', self::NEXT_DEV), + sprintf('- %s: The current development version of Drupal 9, e.g., "9.0.x-dev"', self::D9_READINESS), ]; } diff --git a/src/Utility/DrupalCoreVersionFinder.php b/src/Utility/DrupalCoreVersionFinder.php index ab445667a..eea3cc52b 100644 --- a/src/Utility/DrupalCoreVersionFinder.php +++ b/src/Utility/DrupalCoreVersionFinder.php @@ -66,6 +66,9 @@ public function get(DrupalCoreVersion $version): string { case DrupalCoreVersion::NEXT_DEV: return $this->getNextDevVersion(); + case DrupalCoreVersion::D9_READINESS: + return $this->getD9DevVersion(); + default: throw new \LogicException(sprintf('Unknown version. Update %s:%s.', __CLASS__, __FUNCTION__)); } @@ -97,17 +100,20 @@ public function getPretty(DrupalCoreVersion $version): string { * @param string $minimum_stability * The minimum stability. Available options (in order of stability) are * dev, alpha, beta, RC, and stable. + * @param string $preferred_stability + * The preferred stability. Available options (in order of stability) are + * dev, alpha, beta, RC, and stable. * * @return string * The version string. */ - public function find(string $target_package_version = NULL, string $minimum_stability = 'stable'): string { + public function find(string $target_package_version = NULL, string $minimum_stability = 'stable', string $preferred_stability = 'stable'): string { $best_candidate = $this->getVersionSelector($minimum_stability) - ->findBestCandidate('drupal/core', $target_package_version); + ->findBestCandidate('drupal/core', $target_package_version, NULL, $preferred_stability); if (!$best_candidate) { throw new \RuntimeException(sprintf('No Drupal core version satisfies the given constraints: version=%s, minimum stability=%s', $target_package_version, $minimum_stability)); } - return $best_candidate->getVersion(); + return $best_candidate->getPrettyVersion(); } /** @@ -196,6 +202,18 @@ private function getNextDevVersion(): string { return "{$previous_minor_version}.x-dev"; } + /** + * Gets the next D9 dev version. + * + * @return string + * The version string, e.g., "9.0.x-dev". + * + * @see \Acquia\Orca\Enum\DrupalCoreVersion::D9_READINESS + */ + private function getD9DevVersion(): string { + return $this->find('~9', 'dev', 'dev'); + } + /** * Gets a Composer version selector. * diff --git a/tests/Command/Debug/DebugPackagesCommandTest.php b/tests/Command/Debug/DebugPackagesCommandTest.php index f2b660574..00bb1dd7a 100644 --- a/tests/Command/Debug/DebugPackagesCommandTest.php +++ b/tests/Command/Debug/DebugPackagesCommandTest.php @@ -10,7 +10,6 @@ use Acquia\Orca\Tests\Command\CommandTestBase; use Acquia\Orca\Utility\DrupalCoreVersionFinder; use Composer\Semver\VersionParser; -use Prophecy\Argument; use Symfony\Component\Console\Command\Command; /** @@ -43,8 +42,8 @@ public function testBasicExecution() { $package->getType()->willReturn('drupal-module'); $package->getInstallPathRelative()->willReturn('docroot/modules/contrib/example1', 'docroot/modules/contrib/example2'); $package->getRepositoryUrlRaw()->willReturn('../example1', '../example2'); - $package->getVersionRecommended(NULL)->willReturn('~1.0'); - $package->getVersionDev(NULL)->willReturn('1.x-dev'); + $package->getVersionRecommended('*')->willReturn('~1.0'); + $package->getVersionDev('*')->willReturn('1.x-dev'); $package->shouldGetEnabled()->willReturn(TRUE); $this->packageManager ->getAll() @@ -53,14 +52,14 @@ public function testBasicExecution() { $this->executeCommand(); - $this->assertEquals(ltrim(" -+-----------+---------------+----------------------------------+-------------+---------+-------------+--------+ + $this->assertEquals(ltrim(' ++-----------+---------------+--------------------- Drupal * ---+-------------+---------+-------------+--------+ | Package | type | install_path | url | version | version_dev | enable | +-----------+---------------+----------------------------------+-------------+---------+-------------+--------+ | Example 1 | drupal-module | docroot/modules/contrib/example1 | ../example1 | ~1.0 | 1.x-dev | yes | | Example 2 | drupal-module | docroot/modules/contrib/example2 | ../example2 | ~1.0 | 1.x-dev | yes | +-----------+---------------+----------------------------------+-------------+---------+-------------+--------+ -"), $this->getDisplay(), 'Displayed correct output.'); +'), $this->getDisplay(), 'Displayed correct output.'); $this->assertEquals(StatusCode::OK, $this->getStatusCode(), 'Returned correct status code.'); } @@ -70,26 +69,13 @@ public function testBasicExecution() { public function testValidArguments($argument) { $version = '8.7.0.0'; $this->drupalCoreVersionFinder - ->get(Argument::any()) + ->get(new DrupalCoreVersion($argument)) ->shouldBeCalledOnce() ->willReturn($version); - $package = $this->prophesize(Package::class); - $package->getPackageName()->willReturn('Example 1'); - $package->getType()->willReturn('drupal-module'); - $package->getInstallPathRelative()->willReturn('docroot/modules/contrib/example1'); - $package->getRepositoryUrlRaw()->willReturn('../example1'); - $package->getVersionRecommended($version) - ->shouldBeCalledOnce(); - $package->getVersionDev($version) - ->shouldBeCalledOnce(); - $this->packageManager - ->getAll() - ->shouldBeCalledOnce() - ->willReturn([$package]); - $package->shouldGetEnabled()->willReturn(TRUE); $this->executeCommand(['core' => $argument]); + $this->assertContains(ltrim("- Drupal {$version} -"), $this->getDisplay(), 'Displayed correct output.'); $this->assertEquals(StatusCode::OK, $this->getStatusCode(), 'Returned correct status code.'); } @@ -108,7 +94,7 @@ public function testInvalidArguments($version) { $this->executeCommand(['core' => $version]); $error_message = sprintf('Error: Invalid value for "core" option: "%s".', $version) . PHP_EOL - . 'Hint: Acceptable values are "PREVIOUS_RELEASE", "PREVIOUS_DEV", "CURRENT_RECOMMENDED", "CURRENT_DEV", "NEXT_RELEASE", "NEXT_DEV", or any version string Composer understands.' . PHP_EOL; + . 'Hint: Acceptable values are "PREVIOUS_RELEASE", "PREVIOUS_DEV", "CURRENT_RECOMMENDED", "CURRENT_DEV", "NEXT_RELEASE", "NEXT_DEV", "D9_READINESS", or any version string Composer understands.' . PHP_EOL; $this->assertEquals($error_message, $this->getDisplay(), 'Displayed correct output.'); $this->assertEquals(StatusCode::ERROR, $this->getStatusCode(), 'Returned correct status code.'); } diff --git a/tests/Command/Fixture/FixtureInitCommandTest.php b/tests/Command/Fixture/FixtureInitCommandTest.php index ec307afe2..121c37a5e 100644 --- a/tests/Command/Fixture/FixtureInitCommandTest.php +++ b/tests/Command/Fixture/FixtureInitCommandTest.php @@ -259,7 +259,7 @@ public function testCoreOptionVersionParsing($status_code, $value, $display) { public function providerCoreOptionVersionParsing() { $error_message = 'Error: Invalid value for "--core" option: "%s".' . PHP_EOL - . 'Hint: Acceptable values are "PREVIOUS_RELEASE", "PREVIOUS_DEV", "CURRENT_RECOMMENDED", "CURRENT_DEV", "NEXT_RELEASE", "NEXT_DEV", or any version string Composer understands.' . PHP_EOL; + . 'Hint: Acceptable values are "PREVIOUS_RELEASE", "PREVIOUS_DEV", "CURRENT_RECOMMENDED", "CURRENT_DEV", "NEXT_RELEASE", "NEXT_DEV", "D9_READINESS", or any version string Composer understands.' . PHP_EOL; return [ [StatusCode::OK, self::CORE_VALUE_LITERAL_PREVIOUS_RELEASE, ''], [StatusCode::OK, self::CORE_VALUE_LITERAL_CURRENT_RECOMMENDED, ''], From 1166a9184499e06e473c14c9c080d9397c3033b1 Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Fri, 13 Mar 2020 14:08:36 -0400 Subject: [PATCH 5/5] Bumped version number. --- config/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/VERSION b/config/VERSION index 3d6269b0f..18fa8e74f 100644 --- a/config/VERSION +++ b/config/VERSION @@ -1 +1 @@ -v1.2.4-dev +v1.3.0