/** * Initializes collection with a list of elements. * * @param array $elements Elements. */ public function __construct(array $elements = array()) { if (!$this->elementClass) { $this->elementClass = '\\QATools\\QATools\\HtmlElements\\Element\\AbstractTypifiedElement'; } parent::__construct($elements); }
/** * Locates object inside proxy. * * @return void */ protected function locateObject() { if ($this->locatorUsed) { return; } // NodeElement + TargetElement = Proxy. $this->locatorUsed = true; /** @var AbstractTypifiedElementCollection $object */ $object = call_user_func(array($this->className, 'fromNodeElements'), $this->locateElements(), null, $this->pageFactory); $object->setName($this->getName()); AbstractElementCollection::offsetSet(null, $object); $iterator = $this->getIterator(); /** @var ITypifiedElement $element */ foreach ($iterator as $element) { $element->setName($this->getName()); } }
/** * Returns the array iterator. * * @return \ArrayIterator */ public function getIterator() { $this->locateObject(); return parent::getIterator(); }
public function __construct(array $elements = array()) { $this->elementClass = '\\tests\\QATools\\QATools\\PageObject\\Element\\NodeElementAwareClass'; parent::__construct($elements); }