\Dewdrop\TestDomAssertions

A set of methods useful for making assertions about whether a given HTML snippet matches a CSS or XPath query.

Summary

Methods
Properties
Constants
assertMatchesDomQuery()
assertNotMatchesDomQuery()
queryDom()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

assertMatchesDomQuery()

assertMatchesDomQuery(string  $selector, string  $html) : void

Assert that the supplied CSS selector matches the supplied HTML.

Parameters

string $selector

A CSS selected.

string $html

The HTML you are selecting against.

assertNotMatchesDomQuery()

assertNotMatchesDomQuery(string  $selector, string  $html) : void

Assert that the supplied CSS selector does not have matches in the supplied HTML.

Parameters

string $selector

A CSS selected.

string $html

The HTML you are selecting against.

queryDom()

queryDom(string  $selector, string  $html) : \Zend\Dom\NodeList

Use the supplied CSS selector to query the HTML. Returns the results as a \Zend\Dom\NodeList, which can be iterated over to inspect the resulting DOMElement objects as needed.

Parameters

string $selector
string $html

Returns

\Zend\Dom\NodeList