コード例 #1
0
 /**
  * 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);
 }
コード例 #2
0
 /**
  * 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());
     }
 }
コード例 #3
0
 /**
  * Returns the array iterator.
  *
  * @return \ArrayIterator
  */
 public function getIterator()
 {
     $this->locateObject();
     return parent::getIterator();
 }
コード例 #4
0
 public function __construct(array $elements = array())
 {
     $this->elementClass = '\\tests\\QATools\\QATools\\PageObject\\Element\\NodeElementAwareClass';
     parent::__construct($elements);
 }