Commit 46977028 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2773389 by martin107, claudiu.cristea, klausi:...

Issue #2773389 by martin107, claudiu.cristea, klausi: BrowserTestBase::getTextContent() wrongly returns the raw content

(cherry picked from commit fdb71536)
parent 74cd4ced
Loading
Loading
Loading
Loading
+5
Changes for core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -33,6 +33,11 @@ public function testGoTo() {
    // Test page contains some text.
    $this->assertSession()->pageTextContains('Test page text.');

    // Check that returned plain text is correct.
    $text = $this->getTextContent();
    $this->assertContains('Test page text.', $text);
    $this->assertNotContains('</html>', $text);

    // Response includes cache tags that we can assert.
    $this->assertSession()->responseHeaderEquals('X-Drupal-Cache-Tags', 'rendered');

+1 −1
Changes for core/tests/Drupal/Tests/BrowserTestBase.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -1575,7 +1575,7 @@ protected function clickLink($label) {
   * Retrieves the plain-text content from the current page.
   */
  protected function getTextContent() {
    return $this->getSession()->getPage()->getContent();
    return $this->getSession()->getPage()->getText();
  }

  /**