X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fviews_ui%2Fsrc%2FTests%2FPreviewTest.php;h=c8bd7bd14c2cf6a658c8f248b77051de97f76991;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=95fba8c6ad0340f82d59ab9b32f3239fe320e532;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/views_ui/src/Tests/PreviewTest.php b/web/core/modules/views_ui/src/Tests/PreviewTest.php index 95fba8c6a..c8bd7bd14 100644 --- a/web/core/modules/views_ui/src/Tests/PreviewTest.php +++ b/web/core/modules/views_ui/src/Tests/PreviewTest.php @@ -105,7 +105,13 @@ class PreviewTest extends UITestBase { $this->assertText(t('Query execute time')); $this->assertText(t('View render time')); $this->assertRaw('Query'); - $this->assertText("SELECT views_test_data.name AS views_test_data_name\nFROM \n{views_test_data} views_test_data\nWHERE (views_test_data.id = '100' )"); + $query_string = <<assertEscaped($query_string); // Test that the statistics and query are rendered above the preview. $this->assertTrue(strpos($this->getRawContent(), 'views-query-info') < strpos($this->getRawContent(), 'view-test-preview'), 'Statistics shown above the preview.'); @@ -114,6 +120,12 @@ class PreviewTest extends UITestBase { $settings->set('ui.show.sql_query.where', 'below')->save(); $this->drupalPostForm(NULL, $edit = ['view_args' => '100'], t('Update preview')); $this->assertTrue(strpos($this->getRawContent(), 'view-test-preview') < strpos($this->getRawContent(), 'views-query-info'), 'Statistics shown below the preview.'); + + // Test that the preview title isn't double escaped. + $this->drupalPostForm("admin/structure/views/nojs/display/test_preview/default/title", $edit = ['title' => 'Double & escaped'], t('Apply')); + $this->drupalPostForm(NULL, [], t('Update preview')); + $elements = $this->xpath('//div[@id="views-live-preview"]/div[contains(@class, views-query-info)]//td[text()=:text]', [':text' => t('Double & escaped')]); + $this->assertEqual(1, count($elements)); } /**