Issue #2552893 by mpdonadio: AssertContentTrait::assertEscaped() should use Html::escape()

8.0.x
Alex Pott 2015-08-18 13:01:11 +01:00
parent d519a21b7d
commit 2ecd3534aa
1 changed files with 3 additions and 2 deletions

View File

@ -8,6 +8,7 @@
namespace Drupal\simpletest;
use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Render\RenderContext;
@ -479,7 +480,7 @@ trait AssertContentTrait {
if (!$message) {
$message = SafeMarkup::format('Escaped "@raw" found', array('@raw' => $raw));
}
return $this->assert(strpos($this->getRawContent(), SafeMarkup::checkPlain($raw)) !== FALSE, $message, $group);
return $this->assert(strpos($this->getRawContent(), Html::escape($raw)) !== FALSE, $message, $group);
}
/**
@ -507,7 +508,7 @@ trait AssertContentTrait {
if (!$message) {
$message = SafeMarkup::format('Escaped "@raw" not found', array('@raw' => $raw));
}
return $this->assert(strpos($this->getRawContent(), SafeMarkup::checkPlain($raw)) === FALSE, $message, $group);
return $this->assert(strpos($this->getRawContent(), Html::escape($raw)) === FALSE, $message, $group);
}
/**