Commit 1e56b1fb authored by alexpott's avatar alexpott

Issue #2795111 by Jo Fitzgerald, GoZ, dawehner, klausi: WTB to BTB, add getRawContent() in BTB

parent f1bfa50c
...@@ -718,4 +718,15 @@ protected function buildXPathQuery($xpath, array $args = []) { ...@@ -718,4 +718,15 @@ protected function buildXPathQuery($xpath, array $args = []) {
return $this->assertSession()->buildXPathQuery($xpath, $args); return $this->assertSession()->buildXPathQuery($xpath, $args);
} }
/**
* Gets the current raw content.
*
* @deprecated Scheduled for removal in Drupal 9.0.0.
* Use $this->getSession()->getPage()->getContent() instead.
*/
protected function getRawContent() {
@trigger_error('AssertLegacyTrait::getRawContent() is scheduled for removal in Drupal 9.0.0. Use $this->getSession()->getPage()->getContent() instead.', E_USER_DEPRECATED);
return $this->getSession()->getPage()->getContent();
}
} }
...@@ -146,6 +146,9 @@ public function testLegacyTextAsserts() { ...@@ -146,6 +146,9 @@ public function testLegacyTextAsserts() {
$sanitized = Html::escape($dangerous); $sanitized = Html::escape($dangerous);
$this->assertNoText($dangerous); $this->assertNoText($dangerous);
$this->assertText($sanitized); $this->assertText($sanitized);
// Test getRawContent().
$this->assertSame($this->getSession()->getPage()->getContent(), $this->getRawContent());
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment