diff --git a/core/modules/system/src/Tests/Validation/WidgetBaseErrorElementTest.php b/core/modules/system/src/Tests/Validation/WidgetBaseErrorElementTest.php index 85e0466..7417f87 100644 --- a/core/modules/system/src/Tests/Validation/WidgetBaseErrorElementTest.php +++ b/core/modules/system/src/Tests/Validation/WidgetBaseErrorElementTest.php @@ -37,21 +37,21 @@ class WidgetBaseErrorElementTest extends WebTestBase { * * @var \Drupal\user\UserInterface */ - protected $adminUser; + protected $admin_user; /** * Entity form display. * * @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface */ - protected $formDisplay; + protected $form_display; /** * URL to add new content. * * @var string */ - protected $formContentAddUrl; + protected $form_content_add_url; /** * {@inheritdoc} @@ -60,17 +60,17 @@ protected function setUp() { parent::setUp(); $this->drupalCreateContentType(['type' => 'article']); - $this->adminUser = $this->drupalCreateUser([ + $this->admin_user = $this->drupalCreateUser([ 'create article content', 'edit own article content', 'administer content types', ]); - $this->drupalLogin($this->adminUser); + $this->drupalLogin($this->admin_user); // Set article's form display. - $this->formDisplay = EntityFormDisplay::load('node.article.default'); - if (!$this->formDisplay) { - $this->formDisplay = EntityFormDisplay::create([ + $this->form_display = EntityFormDisplay::load('node.article.default'); + if (!$this->form_display) { + $this->form_display = EntityFormDisplay::create([ 'targetEntityType' => 'node', 'bundle' => 'article', 'mode' => 'default', @@ -78,10 +78,7 @@ protected function setUp() { ])->save(); } - $this->formContentAddUrl = 'node/add/article'; - - $this->drupalGet($this->formContentAddUrl); - $this->assertResponse(200, 'Article add form can be accessed at ' . $this->formContentAddUrl); + $this->form_content_add_url = 'node/add/article'; } /** @@ -90,25 +87,25 @@ protected function setUp() { public function testMultipleFormElementsWidget() { $edit = []; // Add an text area with summary and email field to the article content type. - $fieldStorage = FieldStorageConfig::create([ + $field_storage = FieldStorageConfig::create([ 'field_name' => 'field_test_multiple', 'entity_type' => 'node', 'type' => 'text_with_summary_and_email', ]); - $fieldStorage->save(); + $field_storage->save(); - $fieldInstance = FieldConfig::create([ - 'field_storage' => $fieldStorage, + $field_instance = FieldConfig::create([ + 'field_storage' => $field_storage, 'bundle' => 'article', 'label' => 'Text with summary', 'settings' => [ 'display_summary' => TRUE, ], ]); - $fieldInstance->save(); + $field_instance->save(); - $this->formDisplay - ->setComponent($fieldInstance->getName(), [ + $this->form_display + ->setComponent($field_instance->getName(), [ 'type' => 'text_textarea_with_summary_and_email', ])->save(); @@ -117,12 +114,12 @@ public function testMultipleFormElementsWidget() { $edit['field_test_multiple[0][summary]'] = 'Some summary'; $edit['field_test_multiple[0][value]'] = 'Some text'; $edit['field_test_multiple[0][email]'] = $email; - $this->drupalPostForm($this->formContentAddUrl, $edit, t('Save')); + $this->drupalPostForm($this->form_content_add_url, $edit, t('Save')); $this->assertResponse(200); - $this->assertPattern('/(?ms)