summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2016-02-15 07:36:48 (GMT)
committerNathaniel Catchpole2016-02-15 07:36:48 (GMT)
commit3f6c97421c8c851d268342c4a9da8d97163c6857 (patch)
tree447533c474eb10c04c396b01e50a724c50ee41e4
parent8224349d38c50e2e90f514bf93a09ef8f8681bed (diff)
Issue #2641520 by Mac_Weber, rakesh.gectcr, darkdim: Replace deprecated usage of entity_create('contact_form') with a direct call to ContactForm::create()
-rw-r--r--core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php5
-rw-r--r--core/modules/contact/src/Tests/Views/ContactFieldsTest.php5
2 files changed, 6 insertions, 4 deletions
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
index c8233e2..379659d 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
@@ -12,6 +12,7 @@ use Drupal\field\Entity\FieldStorageConfig;
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 @@ class ConfigTranslationListUiTest extends WebTestBase {
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.
diff --git a/core/modules/contact/src/Tests/Views/ContactFieldsTest.php b/core/modules/contact/src/Tests/Views/ContactFieldsTest.php
index c04a145..25d02d2 100644
--- a/core/modules/contact/src/Tests/Views/ContactFieldsTest.php
+++ b/core/modules/contact/src/Tests/Views/ContactFieldsTest.php
@@ -9,6 +9,7 @@ namespace Drupal\contact\Tests\Views;
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 @@ class ContactFieldsTest extends ViewTestBase {
));
$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,