You are here

public function NodeElementTest::testGetParent in Zircon Profile 8

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

File

vendor/behat/mink/tests/Element/NodeElementTest.php, line 376

Class

NodeElementTest

Namespace

Behat\Mink\Tests\Element

Code

public function testGetParent() {
  $node = new NodeElement('elem', $this->session);
  $parent = $this
    ->getMockBuilder('Behat\\Mink\\Element\\NodeElement')
    ->disableOriginalConstructor()
    ->getMock();
  $this->driver
    ->expects($this
    ->once())
    ->method('find')
    ->with('elem/..')
    ->will($this
    ->returnValue(array(
    $parent,
  )));
  $this->selectors
    ->expects($this
    ->once())
    ->method('selectorToXpath')
    ->with('xpath', '..')
    ->will($this
    ->returnValue('..'));
  $this
    ->assertSame($parent, $node
    ->getParent());
}