Commit 3f6c9742 authored by catch's avatar catch

Issue #2641520 by Mac_Weber, rakesh.gectcr, darkdim: Replace deprecated usage...

Issue #2641520 by Mac_Weber, rakesh.gectcr, darkdim: Replace deprecated usage of  entity_create('contact_form') with a direct call to ContactForm::create()
parent 8224349d
......@@ -12,6 +12,7 @@
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\WebTestBase;
use Drupal\shortcut\Entity\ShortcutSet;
use Drupal\contact\Entity\ContactForm;
/**
* Visit all lists.
......@@ -211,10 +212,10 @@ public function doCustomContentTypeListTest() {
public function doContactFormsListTest() {
// Create a test contact form to decouple looking for translate operations
// link so this does not test more than necessary.
$contact_form = entity_create('contact_form', array(
$contact_form = ContactForm::create([
'id' => Unicode::strtolower($this->randomMachineName(16)),
'label' => $this->randomMachineName(),
));
]);
$contact_form->save();
// Get the contact form listing.
......
......@@ -9,6 +9,7 @@
use Drupal\views\Tests\ViewTestBase;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\contact\Entity\ContactForm;
/**
* Tests which checks that no fieldapi fields are added on contact.
......@@ -41,10 +42,10 @@ protected function setUp() {
));
$this->fieldStorage->save();
entity_create('contact_form', array(
ContactForm::create([
'id' => 'contact_message',
'label' => 'Test contact form',
))->save();
])->save();
entity_create('field_config', array(
'field_storage' => $this->fieldStorage,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment