You are here

public function WebAssertTest::testResponseNotContains in Zircon Profile 8.0

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

File

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

Class

WebAssertTest

Namespace

Behat\Mink\Tests

Code

public function testResponseNotContains() {
  $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 html text'));
  $this
    ->assertCorrectAssertion('responseNotContains', array(
    'PAGE text',
  ));
  $this
    ->assertWrongAssertion('responseNotContains', array(
    'HTML text',
  ), 'Behat\\Mink\\Exception\\ExpectationException', 'The string "HTML text" appears in the HTML response of this page, but it should not.');
}