Commit 74fbb0aa authored by catch's avatar catch
Browse files

Issue #3127141 by mondrake, longwave, alexpott, Neslee Canil Pinto, Suresh...

Issue #3127141 by mondrake, longwave, alexpott, Neslee Canil Pinto, Suresh Prabhu Parkala, ravi.shankar: Use PHPUnit 9 for PHP 7.4+, while keeping support for PHPUnit 8.4 in PHP 7.3
parent 89d9f113
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
        "composer/composer": "^1.9.1",
        "drupal/coder": "^8.3.7",
        "mikey179/vfsstream": "^1.6.8",
        "phpunit/phpunit": "^8.4.1",
        "phpunit/phpunit": "^8.4.1 || ^9",
        "phpspec/prophecy": "^1.7",
        "symfony/css-selector": "^4.4",
        "symfony/phpunit-bridge": "^5.1.4",
@@ -93,7 +93,10 @@
        "pre-update-cmd": "Drupal\\Composer\\Composer::ensureComposerVersion",
        "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
        "drupal-phpunit-upgrade-check": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit",
        "drupal-phpunit-upgrade": "@composer update phpunit/phpunit symfony/phpunit-bridge phpspec/prophecy symfony/yaml --with-dependencies --no-progress",
        "drupal-phpunit-upgrade": [
            "@composer update phpunit/phpunit --with-dependencies --no-progress",
            "@composer require phpspec/prophecy-phpunit:^2 --no-progress --no-suggest"
        ],
        "post-update-cmd": [
            "Drupal\\Composer\\Composer::generateMetapackages"
        ],
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
        "This file is @generated automatically"
    ],
    "content-hash": "059e8aee61edb73b1526b840eb6c624c",
    "content-hash": "09de613d0e44689de15282c33d3d700e",
    "packages": [
        {
            "name": "asm89/stack-cors",
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
        "justinrainbow/json-schema": "^5.2",
        "mikey179/vfsstream": "^1.6.8",
        "phpspec/prophecy": "^1.7",
        "phpunit/phpunit": "^8.4.1",
        "phpunit/phpunit": "^8.4.1 || ^9",
        "symfony/browser-kit": "^4.4",
        "symfony/css-selector": "^4.4",
        "symfony/dom-crawler": "^4.4 !=4.4.5",
+2 −2
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ public static function upgradePHPUnit(Event $event) {
      return;
    }

    // If the PHP version is 7.3 or above and PHPUnit is less than version 7
    // If the PHP version is 7.4 or above and PHPUnit is less than version 9
    // call the drupal-phpunit-upgrade script to upgrade PHPUnit.
    if (!static::upgradePHPUnitCheck($phpunit_package->getVersion())) {
      $event->getComposer()
@@ -332,7 +332,7 @@ public static function upgradePHPUnit(Event $event) {
   *   TRUE if the PHPUnit needs to be upgraded, FALSE if not.
   */
  public static function upgradePHPUnitCheck($phpunit_version) {
    return !(version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION, '7.3') >= 0 && version_compare($phpunit_version, '7.0') < 0);
    return !(version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION, '7.4') >= 0 && version_compare($phpunit_version, '9.0') < 0);
  }

}
+2 −2
Original line number Diff line number Diff line
@@ -70,8 +70,8 @@ public function testNodeTranslation() {

    $normalized = $this->serializer->normalize($node, $this->format);

    $this->assertContains(['lang' => 'en', 'value' => $node->getTitle()], $normalized['title'], 'Original language title has been normalized.');
    $this->assertContains(['lang' => 'de', 'value' => $translation->getTitle()], $normalized['title'], 'Translation language title has been normalized.');
    $this->assertContainsEquals(['lang' => 'en', 'value' => $node->getTitle()], $normalized['title'], 'Original language title has been normalized.');
    $this->assertContainsEquals(['lang' => 'de', 'value' => $translation->getTitle()], $normalized['title'], 'Translation language title has been normalized.');

    /** @var \Drupal\node\NodeInterface $denormalized_node */
    $denormalized_node = $this->serializer->denormalize($normalized, 'Drupal\node\Entity\Node', $this->format);
Loading