/** * If an undefined property method was requested, getProperty() will be called. * @param string $name * @param array $arguments * @return string */ public function __call($name, $arguments) { preg_match('/^get([A-Z]{1}[a-zA-Z]+)Property$/', $name, $property); if (!$property) { parent::__call($name, $arguments); } return $this->getProperty(lcfirst($property[1])); }
/** * @param array|string $selector * @param Session $session * @param Factory $factory */ public function __construct($selector, Session $session, Factory $factory) { $this->selector = $selector; parent::__construct($session, $factory); }
/** * A bit of a hack, we require the Session to create instances of WPTableRow, so we store it here * @param NodeElement $node * @param Session $session */ public function __construct(Session $session, Factory $factory) { parent::__construct($session, $factory); $this->session = $session; }
function it_throws_an_exception_if_locator_does_not_evaluate_to_a_node($selectorsHandler, $driver, $factory, Element $element) { $elementLocator = '//p[@id="navigation"]'; $element->getXpath()->willReturn($elementLocator); $selectorsHandler->selectorToXpath('xpath', $elementLocator)->willReturn($elementLocator); $driver->find('//html' . $elementLocator)->willReturn(null); $factory->createElement('Navigation')->willReturn($element); $this->shouldThrow(new ElementNotFoundException('"Navigation" element is not present on the page'))->duringGetElement('Navigation'); $this->callHasElement('Navigation')->shouldReturn(false); }