public function WebAssertTest::testElementTextNotContains in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/behat/mink/tests/WebAssertTest.php \Behat\Mink\Tests\WebAssertTest::testElementTextNotContains()
File
- vendor/
behat/ mink/ tests/ WebAssertTest.php, line 770
Class
Namespace
Behat\Mink\TestsCode
public function testElementTextNotContains() {
$page = $this
->getMockBuilder('Behat\\Mink\\Element\\DocumentElement')
->disableOriginalConstructor()
->getMock();
$element = $this
->getMockBuilder('Behat\\Mink\\Element\\NodeElement')
->disableOriginalConstructor()
->getMock();
$this->session
->expects($this
->exactly(2))
->method('getPage')
->will($this
->returnValue($page));
$page
->expects($this
->exactly(2))
->method('find')
->with('css', 'h2 > span')
->will($this
->returnValue($element));
$element
->expects($this
->exactly(2))
->method('getText')
->will($this
->returnValue('element text'));
$this
->assertCorrectAssertion('elementTextNotContains', array(
'css',
'h2 > span',
'html',
));
$this
->assertWrongAssertion('elementTextNotContains', array(
'css',
'h2 > span',
'text',
), 'Behat\\Mink\\Exception\\ExpectationException', 'The text "text" appears in the text of the element matching css "h2 > span", but it should not.');
}