WebElementCollectionProxy
class WebElementCollectionProxy extends WebElementProxy (View source)
Class for lazy-proxy creation to ensure, that WebElementCollection are really accessed only at moment, when user needs them.
Properties
protected string | $elementClass | Element class, that is allowed in the collection. | from AbstractElementCollection |
protected string | $className | Class name to proxy. | from AbstractProxy |
protected mixed | $object | Object to proxy. | from AbstractProxy |
protected IElementLocator | $locator | Locator, that can be used to find associated elements on a page. | from AbstractProxy |
protected boolean | $locatorUsed | Determines if a locator was used to locate the elements. | from AbstractProxy |
protected IPageFactory | $pageFactory | Page Factory, that allows to create more elements on demand. | from AbstractProxy |
Methods
Initializes proxy for WebElementCollection.
Determines if an element can be added to a collection.
Offset to set.
Creates new collection by wrapping given array of Node elements.
Determines if class is NodeElement aware.
Checks that element's class is allowed in collection.
No description
Proxies read access for properties to the sub-object.
Proxies write access for properties to the sub-object.
Proxies all methods to sub-object.
Whether an offset exists.
Offset to unset.
Offset to retrieve.
Count elements of an object.
Returns the array iterator.
Locates object inside proxy.
Returns class instance, that was placed inside a proxy.
Details
at line 35
__construct(IElementLocator $locator, IPageFactory $page_factory)
Initializes proxy for WebElementCollection.
protected boolean
acceptElement(mixed $element)
Determines if an element can be added to a collection.
at line 52
void
offsetSet(mixed $index, mixed $newval)
Offset to set.
static AbstractElementCollection
fromNodeElements(array $node_elements, string $element_class = null, IPageFactory $page_factory)
Creates new collection by wrapping given array of Node elements.
protected boolean
isNodeElementAware(string $class_name)
Determines if class is NodeElement aware.
protected boolean
assertElement(mixed $element)
Checks that element's class is allowed in collection.
at line 26
Expectation
shouldReceive(string $name)
in AbstractProxy at line 87
IProxy
setClassName(string $class_name)
Sets class name, used inside the proxy.
in AbstractProxy at line 102
mixed
__get(string $property)
Proxies read access for properties to the sub-object.
in AbstractProxy at line 138
void
__set(string $property, mixed $value)
Proxies write access for properties to the sub-object.
in AbstractProxy at line 176
mixed
__call(string $method, array $arguments)
Proxies all methods to sub-object.
in AbstractProxy at line 209
protected NodeElement
locateElement()
Locates element using the locator.
in AbstractProxy at line 222
protected NodeElement[]
locateElements()
Locates elements using the locator.
at line 64
boolean
offsetExists(mixed $index)
Whether an offset exists.
at line 76
void
offsetUnset(mixed $index)
Offset to unset.
at line 88
mixed|null
offsetGet(mixed $index)
Offset to retrieve.
at line 98
integer
count()
Count elements of an object.
at line 108
ArrayIterator
getIterator()
Returns the array iterator.
at line 118
protected mixed
locateObject()
Locates object inside proxy.
at line 142
mixed
getObject()
Returns class instance, that was placed inside a proxy.