\Dewdrop\TestDbTestCase

This class be extended in your PHPUnit tests to provide PHPUnit with a PDO-basd connection to the WP MySQL database for loading testing fixtures and comparing them with your expected test results.

Summary

Methods
Properties
Constants
assertMatchesDomQuery()
assertNotMatchesDomQuery()
queryDom()
getConnection()
getSetUpOperation()
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

getConnection()

getConnection() : \PDO

Create the PDO connection for PHPUnit using constants defined in wp-config.php.

Returns

\PDO

getSetUpOperation()

getSetUpOperation() : \PHPUnit_Extensions_Database_Operation_Composite

Use our own truncate operation so that we can work with InnoDB foreign keys constraints.

Returns

\PHPUnit_Extensions_Database_Operation_Composite