Unverified Commit 9c0bf60b authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3094151 by mondrake, swatichouhan012, dhirendra.mishra, ravi.shankar,...

Issue #3094151 by mondrake, swatichouhan012, dhirendra.mishra, ravi.shankar, longwave, alexpott: ExpectDeprecationTrait is not compatible with PHPUnit 8

(cherry picked from commit 71a80e78)
parent ca13a977
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -208,8 +208,8 @@ public function testFileRemoval() {
   */
  public function testAssertFileExistsDeprecation() {
    if (RunnerVersion::getMajor() == 6) {
      $this->expectDeprecation('Passing a File entity as $file argument to FileFieldTestBase::assertFileExists is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Instead, pass the File entity URI via File::getFileUri(). See https://www.drupal.org/node/3057326');
      $this->expectDeprecation('Passing a File entity as $file argument to FileFieldTestBase::assertFileNotExists is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Instead, pass the File entity URI via File::getFileUri(). See https://www.drupal.org/node/3057326');
      $this->addExpectedDeprecationMessage('Passing a File entity as $file argument to FileFieldTestBase::assertFileExists is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Instead, pass the File entity URI via File::getFileUri(). See https://www.drupal.org/node/3057326');
      $this->addExpectedDeprecationMessage('Passing a File entity as $file argument to FileFieldTestBase::assertFileNotExists is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Instead, pass the File entity URI via File::getFileUri(). See https://www.drupal.org/node/3057326');
    }
    else {
      $this->markTestSkipped('This test does not work in PHPUnit 7+ since assertFileExists only accepts string arguments for $file');
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ protected function setUp() {
      'd6_node_translation',
    ]);
    $this->executeMigration(\Drupal::service('plugin.manager.migration')->createStubMigration($this->stubMigration));
    $this->expectDeprecation('UrlAlias is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the entity:path_alias destination instead. See https://www.drupal.org/node/3013865');
    $this->addExpectedDeprecationMessage('UrlAlias is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the entity:path_alias destination instead. See https://www.drupal.org/node/3013865');
  }

}
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ protected function setUp() {
      'd7_node_translation',
    ]);
    $this->executeMigration(\Drupal::service('plugin.manager.migration')->createStubMigration($this->stubMigration));
    $this->expectDeprecation('UrlAlias is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the entity:path_alias destination instead. See https://www.drupal.org/node/3013865');
    $this->addExpectedDeprecationMessage('UrlAlias is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the entity:path_alias destination instead. See https://www.drupal.org/node/3013865');
  }

}
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ public function testFormatSpecificGetBcRoute() {
    // new and old sites, but trigger deprecation notices.
    $bc_route = Url::fromRoute('rest.entity.' . static::$entityTypeId . '.GET.' . static::$format, $url->getRouteParameters(), $url->getOptions());
    $bc_route->setUrlGenerator($this->container->get('url_generator'));
    $this->expectDeprecation(sprintf("The 'rest.entity.entity_test.GET.%s' route is deprecated since version 8.5.x and will be removed in 9.0.0. Use the 'rest.entity.entity_test.GET' route instead.", static::$format));
    $this->addExpectedDeprecationMessage(sprintf("The 'rest.entity.entity_test.GET.%s' route is deprecated since version 8.5.x and will be removed in 9.0.0. Use the 'rest.entity.entity_test.GET' route instead.", static::$format));
    $this->assertSame($url->toString(TRUE)->getGeneratedUrl(), $bc_route->toString(TRUE)->getGeneratedUrl());
  }

+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public function testMakeRevisionable() {
      $this->updateEntityTypeToRevisionable();
    }

    $this->expectDeprecation('\Drupal\Core\Entity\Sql\SqlContentEntityStorageSchemaConverter is deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::updateFieldableEntityType() instead. See https://www.drupal.org/node/3029997.');
    $this->addExpectedDeprecationMessage('\Drupal\Core\Entity\Sql\SqlContentEntityStorageSchemaConverter is deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0. Use \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::updateFieldableEntityType() instead. See https://www.drupal.org/node/3029997.');
    $this->runUpdates();

    /** @var \Drupal\Core\Entity\EntityTypeInterface $entity_test_update */
Loading