\Dewdrop\TestBaseTestCase

A simple PHPUnit test case extension that provides some methods for checking HTML output with CSS DOM queries.

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