diff --git a/core/modules/simpletest/src/AssertXpathTrait.php b/core/modules/simpletest/src/AssertXpathTrait.php index 1535bee..5a00d97 100644 --- a/core/modules/simpletest/src/AssertXpathTrait.php +++ b/core/modules/simpletest/src/AssertXpathTrait.php @@ -64,7 +64,7 @@ protected function assertNoFieldByXPath($xpath, $value = NULL, $message = '', $g $found = FALSE; if ($fields) { foreach ($fields as $field) { - if ($field['value'] == $value) { + if ($field->getAttribute('value') === $value) { $found = TRUE; } } diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php index 0024048..343be42 100644 --- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php @@ -94,14 +94,14 @@ public function testAssertions() { $this->drupalLogin($account); $this->drupalGet('admin/people'); - $this->assertFieldByXpath('//table/tbody/tr[2]/td[1]/span', $account->getAccountName()); + $this->assertFieldByXPath('//table/tbody/tr[2]/td[1]/span', $account->getAccountName()); $this->drupalGet('user/' . $account->id() . '/edit'); - $this->assertFieldByXpath("//input[@id = 'edit-name']", $account->getAccountName()); - $this->assertFieldByXpath("//select[@id = 'edit-timezone--2']", 'Australia/Sydney'); + $this->assertFieldByXPath("//input[@id = 'edit-name']", $account->getAccountName()); + $this->assertFieldByXPath("//select[@id = 'edit-timezone--2']", 'Australia/Sydney'); $this->assertNoFieldByXPath('//notexisting'); - $this->assertNoFieldByXpath("//input[@id = 'edit-name']", 'wrong value'); + $this->assertNoFieldByXPath("//input[@id = 'edit-name']", 'wrong value'); } }