You are here

public function WebAssertTest::testPageTextContains in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/behat/mink/tests/WebAssertTest.php \Behat\Mink\Tests\WebAssertTest::testPageTextContains()

File

vendor/behat/mink/tests/WebAssertTest.php, line 329

Class

WebAssertTest

Namespace

Behat\Mink\Tests

Code

public function testPageTextContains() {
  $page = $this
    ->getMockBuilder('Behat\\Mink\\Element\\DocumentElement')
    ->disableOriginalConstructor()
    ->getMock();
  $this->session
    ->expects($this
    ->exactly(2))
    ->method('getPage')
    ->will($this
    ->returnValue($page));
  $page
    ->expects($this
    ->exactly(2))
    ->method('getText')
    ->will($this
    ->returnValue("Some  page\n\ttext"));
  $this
    ->assertCorrectAssertion('pageTextContains', array(
    'PAGE text',
  ));
  $this
    ->assertWrongAssertion('pageTextContains', array(
    'html text',
  ), 'Behat\\Mink\\Exception\\ResponseTextException', 'The text "html text" was not found anywhere in the text of the current page.');
}