diff --git a/core/modules/config/src/Tests/ConfigImportRecreateTest.php b/core/modules/config/src/Tests/ConfigImportRecreateTest.php index 3a24135..bc3a838 100644 --- a/core/modules/config/src/Tests/ConfigImportRecreateTest.php +++ b/core/modules/config/src/Tests/ConfigImportRecreateTest.php @@ -60,12 +60,10 @@ protected function setUp() { public function testRecreateEntity() { $type_name = Unicode::strtolower($this->randomMachineName(16)); - $content_type = entity_create('node_type', array( + $content_type = $this->drupalCreateContentType(array( 'type' => $type_name, 'name' => 'Node type one', )); - $content_type->save(); - node_add_body_field($content_type); /** @var \Drupal\Core\Config\StorageInterface $active */ $active = $this->container->get('config.storage'); /** @var \Drupal\Core\Config\StorageInterface $staging */ @@ -79,12 +77,10 @@ public function testRecreateEntity() { $content_type->delete(); $this->assertFalse($active->exists($config_name), 'Content type\'s old name does not exist active store.'); // Recreate with the same type - this will have a different UUID. - $content_type = entity_create('node_type', array( + $content_type = $this->drupalCreateContentType(array( 'type' => $type_name, 'name' => 'Node type two', )); - $content_type->save(); - node_add_body_field($content_type); $this->configImporter->reset(); // A node type, a field, a field instance an entity view display and an diff --git a/core/modules/editor/src/Tests/EditorFileUsageTest.php b/core/modules/editor/src/Tests/EditorFileUsageTest.php index df950bf..3fa2bf8 100644 --- a/core/modules/editor/src/Tests/EditorFileUsageTest.php +++ b/core/modules/editor/src/Tests/EditorFileUsageTest.php @@ -47,9 +47,7 @@ protected function setUp() { $editor->save(); // Create a node type for testing. - $type = entity_create('node_type', array('type' => 'page', 'name' => 'page')); - $type->save(); - node_add_body_field($type); + $type = $this->drupalCreateContentType(array('type' => 'page', 'name' => 'page')); } /** diff --git a/core/modules/entity/src/Tests/EntityDisplayTest.php b/core/modules/entity/src/Tests/EntityDisplayTest.php index cf2a281..7808688 100644 --- a/core/modules/entity/src/Tests/EntityDisplayTest.php +++ b/core/modules/entity/src/Tests/EntityDisplayTest.php @@ -266,9 +266,7 @@ public function testRenameDeleteBundle() { $this->installEntitySchema('node'); // Create a node bundle, display and form display object. - $type = entity_create('node_type', array('type' => 'article')); - $type->save(); - node_add_body_field($type); + $type = $this->drupalCreateContentType(array('type' => 'article')); entity_get_display('node', 'article', 'default')->save(); entity_get_form_display('node', 'article', 'default')->save();