You are here

public function WebAssertTest::testResponseContains in Zircon Profile 8

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

File

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

Class

WebAssertTest

Namespace

Behat\Mink\Tests

Code

public function testResponseContains() {
  $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('getContent')
    ->will($this
    ->returnValue('Some page text'));
  $this
    ->assertCorrectAssertion('responseContains', array(
    'PAGE text',
  ));
  $this
    ->assertWrongAssertion('responseContains', array(
    'html text',
  ), 'Behat\\Mink\\Exception\\ExpectationException', 'The string "html text" was not found anywhere in the HTML response of the current page.');
}