Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / tests / Drupal / FunctionalTests / Update / UpdatePathTestBase.php
index 4aca50032b34fdfcc52dd313a2b8465629bf2a23..744f527ba2a4d0b0458559125dc157388882d890 100644 (file)
@@ -374,7 +374,6 @@ abstract class UpdatePathTestBase extends BrowserTestBase {
 
       // Ensure that the update hooks updated all entity schema.
       $needs_updates = \Drupal::entityDefinitionUpdateManager()->needsUpdates();
-      $this->assertFalse($needs_updates, 'After all updates ran, entity schema is up to date.');
       if ($needs_updates) {
         foreach (\Drupal::entityDefinitionUpdateManager()
           ->getChangeSummary() as $entity_type_id => $summary) {
@@ -382,6 +381,9 @@ abstract class UpdatePathTestBase extends BrowserTestBase {
             $this->fail($message);
           }
         }
+        // The above calls to `fail()` should prevent this from ever being
+        // called, but it is here in case something goes really wrong.
+        $this->assertFalse($needs_updates, 'After all updates ran, entity schema is up to date.');
       }
     }
   }