diff --git a/core/modules/link/tests/src/Functional/LinkFieldTest.php b/core/modules/link/tests/src/Functional/LinkFieldTest.php index ecfadcd..d74c3a1 100644 --- a/core/modules/link/tests/src/Functional/LinkFieldTest.php +++ b/core/modules/link/tests/src/Functional/LinkFieldTest.php @@ -818,22 +818,22 @@ function testLinkRequired() { // Tests if both URL and link text are both marked as required for the field // $field_both_required. $result = $this->xpath('//label[contains(@class, :class) and contains(text(), :text) and contains(@for, :for)]', [':class' => 'form-required', ':text' => 'URL', ':for' => 'edit-' . $field_both_required . '-0-uri']); - $this->assertEqual(count($result), 1, "URL is marked as required when both the URL and link field are set to required."); + $this->assertEquals(count($result), 1, "URL is marked as required when both the URL and link field are set to required."); $result = $this->xpath('//label[contains(@class, :class) and contains(text(), :text) and contains(@for, :for)]', [':class' => 'form-required', ':text' => 'Link text', ':for' => 'edit-' . $field_both_required . '-0-title']); - $this->assertEqual(count($result), 1, "Link text is marked as required when both the URL and link field are set to required."); + $this->assertEquals(count($result), 1, "Link text is marked as required when both the URL and link field are set to required."); // Tests if only link text marked as required for the field $field_url_only. $result = $this->xpath('//label[contains(@class, :class) and contains(@for, :for)]', [':class' => 'form-required', ':for' => 'edit-' . $field_url_only . '-0-uri']); - $this->assertEqual(count($result), 1, "URL is marked as required when only the URL is set to required."); + $this->assertEquals(count($result), 1, "URL is marked as required when only the URL is set to required."); $result = $this->xpath('//label[not(contains(@class, :class)) and contains(@for, :for)]', [':class' => 'form-required', ':for' => 'edit-' . $field_url_only . '-0-title']); - $this->assertEqual(count($result), 1, "Link text is not marked as required when only the URL is set to required."); + $this->assertEquals(count($result), 1, "Link text is not marked as required when only the URL is set to required."); // Tests if URL or or link text are not marked as required for // $field_text_only before posting the form. $result = $this->xpath('//label[not(contains(@class, :class)) and contains(@for, :for)]', [':class' => 'form-required', ':for' => 'edit-' . $field_text_only . '-0-uri']); - $this->assertEqual(count($result), 1, "Before posting the form the URL is not marked as required when only link text is set as required."); + $this->assertEquals(count($result), 1, "Before posting the form the URL is not marked as required when only link text is set as required."); $result = $this->xpath('//label[not(contains(@class, :class)) and contains(@for, :for)]', [':class' => 'form-required', ':for' => 'edit-' . $field_text_only . '-0-title']); - $this->assertEqual(count($result), 1, "Before posting the form the link text is not marked as required when only the link text is set to required."); + $this->assertEquals(count($result), 1, "Before posting the form the link text is not marked as required when only the link text is set to required."); // Tests if the link text is not marked as required after posting a form // with data only for URL for the field $field_url_only. @@ -843,7 +843,7 @@ function testLinkRequired() { "{$field_url_only}[0][uri]" => 'http://www.example.com', ]; $this->drupalPostForm('entity_test/add', $edit, t('Save')); - $this->assertNoText(t('@name field is required.', array('@name' => t('Link text')))); + $this->assertSession()->pageTextNotContains(t('@name field is required.', array('@name' => t('Link text')))); // Posts all required data, except for the link text for $field_text_only. $edit = [ @@ -857,9 +857,9 @@ function testLinkRequired() { // Tests if only link text is marked as required for $field_text_only after // posting a form with URL, but without link text. $result = $this->xpath('//label[not(contains(@class, :class)) and contains(@for, :for)]', [':class' => 'form-required', ':for' => 'edit-' . $field_text_only . '-0-uri']); - $this->assertEqual(count($result), 1, "URL is not marked as required when only link text is set as required."); + $this->assertEquals(count($result), 1, "URL is not marked as required when only link text is set as required."); $result = $this->xpath('//label[contains(@class, :class) and contains(@for, :for)]', [':class' => 'form-required', ':for' => 'edit-' . $field_text_only . '-0-title']); - $this->assertEqual(count($result), 1, "Link text is marked as required when only the link text is set to required."); + $this->assertEquals(count($result), 1, "Link text is marked as required when only the link text is set to required."); } }