commit f97208eaafd261da841a8a846ecb53393fbddbb3 Author: Joel Pittet Date: Mon Aug 17 17:56:18 2015 -0700 escape diff --git a/core/modules/filter/src/Tests/FilterAdminTest.php b/core/modules/filter/src/Tests/FilterAdminTest.php index 6f29c41..edeb7be 100644 --- a/core/modules/filter/src/Tests/FilterAdminTest.php +++ b/core/modules/filter/src/Tests/FilterAdminTest.php @@ -7,7 +7,7 @@ namespace Drupal\filter\Tests; -use Drupal\Component\Utility\SafeMarkup; +use Drupal\Component\Utility\Html; use Drupal\Component\Utility\Unicode; use Drupal\simpletest\WebTestBase; use Drupal\user\RoleInterface; @@ -312,7 +312,7 @@ function testFilterAdmin() { $edit['body[0][format]'] = $plain; $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save')); $this->drupalGet('node/' . $node->id()); - $this->assertText(SafeMarkup::checkPlain($text), 'The "Plain text" text format escapes all HTML tags.'); + $this->assertText(Html::escape($text), 'The "Plain text" text format escapes all HTML tags.'); $this->config('filter.settings') ->set('always_show_fallback_choice', FALSE) ->save(); @@ -370,10 +370,10 @@ function testFilterTipHtmlEscape() { // It is not possible to test the whole filter tip page. // Therefore we test only some parts. - $link = '' . htmlspecialchars(\Drupal::config('system.site')->get('name'), ENT_QUOTES, 'utf-8') . ''; + $link = '' . Html::escape(\Drupal::config('system.site')->get('name')) . ''; $ampersand = '&'; - $link_as_code = '' . htmlspecialchars($link, ENT_QUOTES, 'utf-8') . ''; - $ampersand_as_code = '' . htmlspecialchars($ampersand, ENT_QUOTES, 'utf-8') . ''; + $link_as_code = '' . Html::escape($link) . ''; + $ampersand_as_code = '' . Html::escape($ampersand) . ''; $this->drupalGet('filter/tips');