Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / system / tests / src / Functional / Entity / Update / UpdateApiEntityDefinitionUpdateTest.php
index 89c1d7072d78b94a820e40531fbbdfce46405fc1..f3285ae5d5ecb72dfabf8f4e23127926fa86b2f6 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace Drupal\Tests\system\Functional\Entity\Update;
 
-use Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException;
 use Drupal\entity_test\Entity\EntityTest;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\Tests\system\Functional\Update\DbUpdatesTrait;
@@ -165,30 +164,12 @@ class UpdateApiEntityDefinitionUpdateTest extends BrowserTestBase {
     $this->assertNoRaw('Out of date');
     $this->assertRaw('Mismatched entity and/or field definitions');
 
-    // Check that en exception would be triggered when trying to apply them with
-    // existing data.
-    $message = 'Entity updates cannot run if entity data exists.';
-    try {
-      $this->updatesManager->applyUpdates();
-      $this->fail($message);
-    }
-    catch (FieldStorageDefinitionUpdateForbiddenException $e) {
-      $this->pass($message);
-    }
-
-    // Check the status report is the same after trying to apply updates.
+    // Apply the entity updates and check that the entity update status report
+    // item is no longer displayed.
+    $this->updatesManager->applyUpdates();
     $this->drupalGet('admin/reports/status');
     $this->assertNoRaw('Out of date');
-    $this->assertRaw('Mismatched entity and/or field definitions');
-
-    // Delete entity data, enable a new update, run updates again and check that
-    // entity updates were not applied even when no data exists.
-    $entity->delete();
-    $this->enableUpdates('entity_test', 'status_report', 8002);
-    $this->applyUpdates();
-    $this->drupalGet('admin/reports/status');
-    $this->assertNoRaw('Out of date');
-    $this->assertRaw('Mismatched entity and/or field definitions');
+    $this->assertNoRaw('Mismatched entity and/or field definitions');
   }
 
   /**