public function testElementIsNotValid() { $node = new NodeElement('some xpath', $this->session); $this->driver->expects($this->exactly(2))->method('find')->with('some xpath')->will($this->onConsecutiveCalls(array(), array('xpath1', 'xpath2'))); $this->assertFalse($node->isValid(), 'no elements found is invalid element'); $this->assertFalse($node->isValid(), 'more then 1 element found is invalid element'); }