You are here

public function WebAssertTest::testResponseNotMatches in Zircon Profile 8.0

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

File

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

Class

WebAssertTest

Namespace

Behat\Mink\Tests

Code

public function testResponseNotMatches() {
  $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('responseNotMatches', array(
    '/PA.E/i',
  ));
  $this
    ->assertWrongAssertion('responseNotMatches', array(
    '/HTML/i',
  ), 'Behat\\Mink\\Exception\\ExpectationException', 'The pattern /HTML/i was found in the HTML response of the page, but it should not.');
}