diff core/modules/config/tests/src/Functional/ConfigEntityTest.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
line wrap: on
line diff
--- a/core/modules/config/tests/src/Functional/ConfigEntityTest.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/modules/config/tests/src/Functional/ConfigEntityTest.php	Thu May 09 15:34:47 2019 +0100
@@ -60,7 +60,7 @@
     $this->assertIdentical($empty->getEntityTypeId(), 'config_test');
     // The URI can only be checked after saving.
     try {
-      $empty->urlInfo();
+      $empty->toUrl();
       $this->fail('EntityMalformedException was thrown.');
     }
     catch (EntityMalformedException $e) {
@@ -119,7 +119,7 @@
     }
 
     // The entity path can only be checked after saving.
-    $this->assertIdentical($config_test->url(), Url::fromRoute('entity.config_test.edit_form', ['config_test' => $expected['id']])->toString());
+    $this->assertIdentical($config_test->toUrl()->toString(), Url::fromRoute('entity.config_test.edit_form', ['config_test' => $expected['id']])->toString());
 
     // Verify that the correct status is returned and properties did not change.
     $this->assertIdentical($status, SAVED_NEW);
@@ -316,7 +316,8 @@
     $this->assertLinkByHref('admin/structure/config_test/manage/0');
     $this->assertLinkByHref('admin/structure/config_test/manage/0/delete');
     $this->drupalPostForm('admin/structure/config_test/manage/0/delete', [], 'Delete');
-    $this->assertFalse(entity_load('config_test', '0'), 'Test entity deleted');
+    $storage = \Drupal::entityTypeManager()->getStorage('config_test');
+    $this->assertNull($storage->load(0), 'Test entity deleted');
 
     // Create a configuration entity with a property that uses AJAX to show
     // extra form elements. Test this scenario in a non-JS case by using a
@@ -343,7 +344,7 @@
     $edit += ['size_value' => 'medium'];
     $this->drupalPostForm(NULL, $edit, 'Save');
 
-    $entity = entity_load('config_test', $id);
+    $entity = $storage->load($id);
     $this->assertEqual($entity->get('size'), 'custom');
     $this->assertEqual($entity->get('size_value'), 'medium');
   }