Commit 5e36ee89 authored by Jess's avatar Jess
Browse files

Issue #3123253 by mondrake, Lal_, prabha1997, longwave, xjm, alexpott, jungle:...

Issue #3123253 by mondrake, Lal_, prabha1997, longwave, xjm, alexpott, jungle: Remove usage of AssertLegacyTrait::pass() from base test classes

(cherry picked from commit 7b1f3e11)
parent af2e4d0d
Loading
Loading
Loading
Loading
+0 −4
Changes for core/modules/comment/tests/src/Functional/CommentTestBase.php: 0 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -249,8 +249,6 @@ public function setCommentSubject($enabled) {
      $form_display->removeComponent('subject');
    }
    $form_display->save();
    // Display status message.
    $this->pass('Comment subject ' . ($enabled ? 'enabled' : 'disabled') . '.');
  }

  /**
@@ -336,8 +334,6 @@ public function setCommentSettings($name, $value, $message, $field_name = 'comme
    $field = FieldConfig::loadByName('node', 'article', $field_name);
    $field->setSetting($name, $value);
    $field->save();
    // Display status message.
    $this->pass($message);
  }

  /**
+0 −16
Changes for core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php: 0 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -382,7 +382,6 @@ public function testReferencedEntity() {
    $nonempty_entity_listing_cache_tags = Cache::mergeTags($nonempty_entity_listing_cache_tags, $this->getAdditionalCacheTagsForEntityListing($this->entity));
    $nonempty_entity_listing_cache_tags = Cache::mergeTags($nonempty_entity_listing_cache_tags, $page_cache_tags);

    $this->pass("Test referencing entity.", 'Debug');
    $this->verifyPageCache($referencing_entity_url, 'MISS');

    // Verify a cache hit, but also the presence of the correct cache tags.
@@ -405,7 +404,6 @@ public function testReferencedEntity() {
    }
    $this->verifyRenderCache($cid, $referencing_entity_cache_tags, $redirected_cid);

    $this->pass("Test non-referencing entity.", 'Debug');
    $this->verifyPageCache($non_referencing_entity_url, 'MISS');
    // Verify a cache hit, but also the presence of the correct cache tags.
    $this->verifyPageCache($non_referencing_entity_url, 'HIT', Cache::mergeTags($non_referencing_entity_cache_tags, $page_cache_tags));
@@ -414,7 +412,6 @@ public function testReferencedEntity() {
    $cid = $this->createCacheId($cache_keys, $entity_cache_contexts);
    $this->verifyRenderCache($cid, $non_referencing_entity_cache_tags);

    $this->pass("Test listing of referencing entities.", 'Debug');
    // Prime the page cache for the listing of referencing entities.
    $this->verifyPageCache($listing_url, 'MISS');

@@ -423,7 +420,6 @@ public function testReferencedEntity() {
    $expected_tags = Cache::mergeTags($expected_tags, $page_cache_tags_referencing_entity);
    $this->verifyPageCache($listing_url, 'HIT', $expected_tags);

    $this->pass("Test empty listing.", 'Debug');
    // Prime the page cache for the empty listing.
    $this->verifyPageCache($empty_entity_listing_url, 'MISS');
    // Verify a cache hit, but also the presence of the correct cache tags.
@@ -432,7 +428,6 @@ public function testReferencedEntity() {
    $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts');
    $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header));

    $this->pass("Test listing containing referenced entity.", 'Debug');
    // Prime the page cache for the listing containing the referenced entity.
    $this->verifyPageCache($nonempty_entity_listing_url, 'MISS', $nonempty_entity_listing_cache_tags);
    // Verify a cache hit, but also the presence of the correct cache tags.
@@ -443,7 +438,6 @@ public function testReferencedEntity() {

    // Verify that after modifying the referenced entity, there is a cache miss
    // for every route except the one for the non-referencing entity.
    $this->pass("Test modification of referenced entity.", 'Debug');
    $this->entity->save();
    $this->verifyPageCache($referencing_entity_url, 'MISS');
    $this->verifyPageCache($listing_url, 'MISS');
@@ -460,7 +454,6 @@ public function testReferencedEntity() {
    // Verify that after modifying the referencing entity, there is a cache miss
    // for every route except the ones for the non-referencing entity and the
    // empty entity listing.
    $this->pass("Test modification of referencing entity.", 'Debug');
    $this->referencingEntity->save();
    $this->verifyPageCache($referencing_entity_url, 'MISS');
    $this->verifyPageCache($listing_url, 'MISS');
@@ -475,7 +468,6 @@ public function testReferencedEntity() {

    // Verify that after modifying the non-referencing entity, there is a cache
    // miss only for the non-referencing entity route.
    $this->pass("Test modification of non-referencing entity.", 'Debug');
    $this->nonReferencingEntity->save();
    $this->verifyPageCache($referencing_entity_url, 'HIT');
    $this->verifyPageCache($listing_url, 'HIT');
@@ -491,7 +483,6 @@ public function testReferencedEntity() {
      // for both the referencing entity, and the listing of referencing
      // entities, but not for any other routes.
      $referenced_entity_view_mode = $this->selectViewMode($this->entity->getEntityTypeId());
      $this->pass("Test modification of referenced entity's '$referenced_entity_view_mode' display.", 'Debug');
      /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
      $display_repository = \Drupal::service('entity_display.repository');
      $entity_display = $display_repository->getViewDisplay($entity_type, $this->entity->bundle(), $referenced_entity_view_mode);
@@ -511,7 +502,6 @@ public function testReferencedEntity() {
      // Verify that after modifying the corresponding bundle entity, there is a
      // cache miss for both the referencing entity, and the listing of
      // referencing entities, but not for any other routes.
      $this->pass("Test modification of referenced entity's bundle entity.", 'Debug');
      $bundle_entity = $this->container->get('entity_type.manager')
        ->getStorage($bundle_entity_type_id)
        ->load($this->entity->bundle());
@@ -543,7 +533,6 @@ public function testReferencedEntity() {
    if ($this->entity->getEntityType()->get('field_ui_base_route')) {
      // Verify that after modifying a configurable field on the entity, there
      // is a cache miss.
      $this->pass("Test modification of referenced entity's configurable field.", 'Debug');
      $field_storage_name = $this->entity->getEntityTypeId() . '.configurable_field';
      $field_storage = FieldStorageConfig::load($field_storage_name);
      $field_storage->save();
@@ -559,7 +548,6 @@ public function testReferencedEntity() {

      // Verify that after modifying a configurable field on the entity, there
      // is a cache miss.
      $this->pass("Test modification of referenced entity's configurable field.", 'Debug');
      $field_name = $this->entity->getEntityTypeId() . '.' . $this->entity->bundle() . '.configurable_field';
      $field = FieldConfig::load($field_name);
      $field->save();
@@ -577,7 +565,6 @@ public function testReferencedEntity() {
    // Verify that after invalidating the entity's cache tag directly, there is
    // a cache miss for every route except the ones for the non-referencing
    // entity and the empty entity listing.
    $this->pass("Test invalidation of referenced entity's cache tag.", 'Debug');
    Cache::invalidateTags($this->entity->getCacheTagsToInvalidate());
    $this->verifyPageCache($referencing_entity_url, 'MISS');
    $this->verifyPageCache($listing_url, 'MISS');
@@ -593,7 +580,6 @@ public function testReferencedEntity() {
    // Verify that after invalidating the entity's list cache tag directly,
    // there is a cache miss for both the empty entity listing and the non-empty
    // entity listing routes, but not for other routes.
    $this->pass("Test invalidation of referenced entity's list cache tag.", 'Debug');
    Cache::invalidateTags($this->entity->getEntityType()->getListCacheTags());
    $this->verifyPageCache($empty_entity_listing_url, 'MISS');
    $this->verifyPageCache($nonempty_entity_listing_url, 'MISS');
@@ -609,7 +595,6 @@ public function testReferencedEntity() {
      // Verify that after invalidating the generic entity type's view cache tag
      // directly, there is a cache miss for both the referencing entity, and the
      // listing of referencing entities, but not for other routes.
      $this->pass("Test invalidation of referenced entity's 'view' cache tag.", 'Debug');
      Cache::invalidateTags($view_cache_tag);
      $this->verifyPageCache($referencing_entity_url, 'MISS');
      $this->verifyPageCache($listing_url, 'MISS');
@@ -624,7 +609,6 @@ public function testReferencedEntity() {

    // Verify that after deleting the entity, there is a cache miss for every
    // route except for the non-referencing entity one.
    $this->pass('Test deletion of referenced entity.', 'Debug');
    $this->entity->delete();
    $this->verifyPageCache($referencing_entity_url, 'MISS');
    $this->verifyPageCache($listing_url, 'MISS');
+0 −9
Changes for core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php: 0 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ public function testEntityUri() {
    $view_cache_tag = \Drupal::entityTypeManager()->getViewBuilder($entity_type)->getCacheTags();
    $render_cache_tag = 'rendered';

    $this->pass("Test entity.", 'Debug');
    $this->verifyPageCache($entity_url, 'MISS');

    // Verify a cache hit, but also the presence of the correct cache tags.
@@ -57,7 +56,6 @@ public function testEntityUri() {
    }

    // Verify that after modifying the entity, there is a cache miss.
    $this->pass("Test modification of entity.", 'Debug');
    $this->entity->save();
    $this->verifyPageCache($entity_url, 'MISS');

@@ -65,7 +63,6 @@ public function testEntityUri() {
    $this->verifyPageCache($entity_url, 'HIT');

    // Verify that after modifying the entity's display, there is a cache miss.
    $this->pass("Test modification of entity's '$view_mode' display.", 'Debug');
    $entity_display = \Drupal::service('entity_display.repository')->getViewDisplay($entity_type, $this->entity->bundle(), $view_mode);
    $entity_display->save();
    $this->verifyPageCache($entity_url, 'MISS');
@@ -76,7 +73,6 @@ public function testEntityUri() {
    if ($bundle_entity_type_id = $this->entity->getEntityType()->getBundleEntityType()) {
      // Verify that after modifying the corresponding bundle entity, there is a
      // cache miss.
      $this->pass("Test modification of entity's bundle entity.", 'Debug');
      $bundle_entity = $this->container->get('entity_type.manager')
        ->getStorage($bundle_entity_type_id)
        ->load($this->entity->bundle());
@@ -90,7 +86,6 @@ public function testEntityUri() {
    if ($this->entity->getEntityType()->get('field_ui_base_route')) {
      // Verify that after modifying a configurable field on the entity, there
      // is a cache miss.
      $this->pass("Test modification of entity's configurable field.", 'Debug');
      $field_storage_name = $this->entity->getEntityTypeId() . '.configurable_field';
      $field_storage = FieldStorageConfig::load($field_storage_name);
      $field_storage->save();
@@ -101,7 +96,6 @@ public function testEntityUri() {

      // Verify that after modifying a configurable field on the entity, there
      // is a cache miss.
      $this->pass("Test modification of entity's configurable field.", 'Debug');
      $field_name = $this->entity->getEntityTypeId() . '.' . $this->entity->bundle() . '.configurable_field';
      $field = FieldConfig::load($field_name);
      $field->save();
@@ -113,7 +107,6 @@ public function testEntityUri() {

    // Verify that after invalidating the entity's cache tag directly, there is
    // a cache miss.
    $this->pass("Test invalidation of entity's cache tag.", 'Debug');
    Cache::invalidateTags($this->entity->getCacheTagsToInvalidate());
    $this->verifyPageCache($entity_url, 'MISS');

@@ -122,7 +115,6 @@ public function testEntityUri() {

    // Verify that after invalidating the generic entity type's view cache tag
    // directly, there is a cache miss.
    $this->pass("Test invalidation of entity's 'view' cache tag.", 'Debug');
    Cache::invalidateTags($view_cache_tag);
    $this->verifyPageCache($entity_url, 'MISS');

@@ -130,7 +122,6 @@ public function testEntityUri() {
    $this->verifyPageCache($entity_url, 'HIT');

    // Verify that after deleting the entity, there is a cache miss.
    $this->pass('Test deletion of entity.', 'Debug');
    $this->entity->delete();
    $this->verifyPageCache($entity_url, 'MISS');
    $this->assertResponse(404);
+0 −1
Changes for core/modules/tour/tests/src/Functional/TourTestBase.php: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ public function assertTourTips($tips = []) {
        }
        $total++;
      }
      $this->pass(new FormattableMarkup('Total %total Tips tested of which %modals modal(s).', ['%total' => $total, '%modals' => $modals]));
    }
  }

+0 −6
Changes for core/tests/Drupal/FunctionalTests/Installer/ConfigAfterInstallerTestBase.php: 0 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -32,13 +32,7 @@ protected function assertInstalledConfig(array $skipped_config) {

    foreach ($profile_config_storage->listAll() as $config_name) {
      $result = $config_manager->diff($profile_config_storage, $active_config_storage, $config_name);
      try {
      $this->assertConfigDiff($result, $config_name, $skipped_config);
        $this->pass("$config_name has no differences");
      }
      catch (\Exception $e) {
        $this->fail($e->getMessage());
      }
    }
  }

Loading