diff --git a/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php b/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php index efb3d2f..2e0e422 100644 --- a/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php +++ b/core/modules/aggregator/src/Tests/AggregatorRenderingTest.php @@ -123,7 +123,7 @@ public function testFeedPage() { $outline = $this->xpath('//outline[1]'); $this->assertEqual($outline[0]['type'], 'rss', 'The correct type attribute is used for rss OPML.'); $this->assertEqual($outline[0]['text'], $feed->label(), 'The correct text attribute is used for rss OPML.'); - $this->assertEqual($outline[0]['xmlurl'], $feed->getUrl(), 'The correct xmlUrl attribute is used for rss OPML.'); + $this->assertEqual($outline[0]['xmlUrl'], $feed->getUrl(), 'The correct xmlUrl attribute is used for rss OPML.'); // Check for the presence of a pager. $this->drupalGet('aggregator/sources/' . $feed->id()); diff --git a/core/modules/comment/src/Tests/Views/RowRssTest.php b/core/modules/comment/src/Tests/Views/RowRssTest.php index 89b9c1b..4536652 100644 --- a/core/modules/comment/src/Tests/Views/RowRssTest.php +++ b/core/modules/comment/src/Tests/Views/RowRssTest.php @@ -31,7 +31,7 @@ public function testRssRow() { $result = $this->xpath('//item'); $this->assertEqual(count($result), 1, 'Just one comment was found in the rss output.'); - $this->assertEqual($result[0]->pubdate, gmdate('r', $this->comment->getCreatedTime()), 'The right pubDate appears in the rss output.'); + $this->assertEqual($result[0]->pubDate, gmdate('r', $this->comment->getCreatedTime()), 'The right pubDate appears in the rss output.'); } } diff --git a/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php b/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php index c4b81ea..6e7316d 100644 --- a/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php +++ b/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php @@ -85,7 +85,10 @@ public function testUsersWithoutPermission() { $this->drupalGet('node/1'); // Ensure the text is transformed. - $this->assertRaw('

Do you also love Drupal?

Druplicon
'); + $this->assertRaw('

Do you also love Drupal?

+ +
Druplicon
+
'); // Retrieving the untransformed text should result in an empty 403 response. $response = $this->drupalPost('editor/' . 'node/1/body/en/full', 'application/vnd.drupal-ajax', array()); @@ -103,7 +106,10 @@ public function testUserWithPermission() { $this->drupalGet('node/1'); // Ensure the text is transformed. - $this->assertRaw('

Do you also love Drupal?

Druplicon
'); + $this->assertRaw('

Do you also love Drupal?

+ +
Druplicon
+
'); $response = $this->drupalPost('editor/' . 'node/1/body/en/full', 'application/vnd.drupal-ajax', array()); $this->assertResponse(200); diff --git a/core/modules/image/src/Tests/ImageFieldDisplayTest.php b/core/modules/image/src/Tests/ImageFieldDisplayTest.php index b73c06f..42d71ac 100644 --- a/core/modules/image/src/Tests/ImageFieldDisplayTest.php +++ b/core/modules/image/src/Tests/ImageFieldDisplayTest.php @@ -290,8 +290,8 @@ function testImageFieldSettings() { $edit = array(); $edit['files[' . $field_name . '_2][]'] = drupal_realpath($test_image->uri); $this->drupalPostAjaxForm(NULL, $edit, $field_name . '_2_upload_button'); - $this->assertNoRaw(''); - $this->assertRaw(''); + $this->assertNoRaw(''); + $this->assertRaw(''); } /** diff --git a/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php b/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php index efd66eb..74e4750 100644 --- a/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php +++ b/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php @@ -7,6 +7,7 @@ namespace Drupal\rdf\Tests\Field; use Drupal\field\Tests\FieldUnitTestBase; +use Drupal\simpletest\XPathExpressionParser; use Masterminds\HTML5; abstract class FieldRdfaTestBase extends FieldUnitTestBase { @@ -179,6 +180,14 @@ protected function parseContent($content) { protected function xpathContent($content, $xpath, array $arguments = array()) { if ($elements = $this->parseContent($content)) { $xpath = $this->buildXPathQuery($xpath, $arguments); + + // Register the default namespace if it exists. + $namespaces = $elements->getDocNamespaces(); + if (!empty($namespaces[''])) { + $xpath = XPathExpressionParser::rewrite($xpath); + $elements->registerXPathNamespace('__x__', $namespaces['']); + } + $result = $elements->xpath($xpath); // Some combinations of PHP / libxml versions return an empty array // instead of the documented FALSE. Forcefully convert any falsish values diff --git a/core/modules/system/src/Tests/Menu/MenuTestBase.php b/core/modules/system/src/Tests/Menu/MenuTestBase.php index 2478af3..eb62547 100644 --- a/core/modules/system/src/Tests/Menu/MenuTestBase.php +++ b/core/modules/system/src/Tests/Menu/MenuTestBase.php @@ -117,7 +117,7 @@ protected function assertMenuActiveTrail($tree, $last_active) { $xpath .= '//'; } $xpath_last_active = ($last_active ? 'and contains(@class, :class-active)' : ''); - $xpath .= 'li[contains(@class, :class-trail)]/a[contains(@href, :href) ' . $xpath_last_active . 'and contains(text(), :title)]'; + $xpath .= 'li[contains(@class, :class-trail)]/a[contains(@href, :href) ' . $xpath_last_active . ' and contains(text(), :title)]'; $args = array( ':class-trail' => 'active-trail', ':class-active' => 'active', diff --git a/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesZeroForm.php b/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesZeroForm.php index ccd752f..e7d0aa6 100644 --- a/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesZeroForm.php +++ b/core/modules/system/tests/modules/form_test/src/Form/FormTestCheckboxesZeroForm.php @@ -56,7 +56,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $json = T * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - if ($form_state->has('json')) { + if ($form_state->get('json')) { $form_state->setResponse(new JsonResponse($form_state->getValues())); } else { diff --git a/core/modules/views/src/Tests/Handler/FieldWebTest.php b/core/modules/views/src/Tests/Handler/FieldWebTest.php index e953ead..e9f65ce 100644 --- a/core/modules/views/src/Tests/Handler/FieldWebTest.php +++ b/core/modules/views/src/Tests/Handler/FieldWebTest.php @@ -10,6 +10,7 @@ use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\String; use Drupal\Component\Utility\UrlHelper; +use Drupal\simpletest\XPathExpressionParser; use Drupal\views\Views; use Masterminds\HTML5; @@ -164,6 +165,14 @@ protected function parseContent($content) { protected function xpathContent($content, $xpath, array $arguments = array()) { if ($elements = $this->parseContent($content)) { $xpath = $this->buildXPathQuery($xpath, $arguments); + + // Register the default namespace if it exists. + $namespaces = $elements->getDocNamespaces(); + if (!empty($namespaces[''])) { + $xpath = XPathExpressionParser::rewrite($xpath); + $elements->registerXPathNamespace('__x__', $namespaces['']); + } + $result = $elements->xpath($xpath); // Some combinations of PHP / libxml versions return an empty array // instead of the documented FALSE. Forcefully convert any falsish values