PHPackages                             danielbachhuber/unholy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. danielbachhuber/unholy

ActiveLibrary[Testing &amp; Quality](/categories/testing)

danielbachhuber/unholy
======================

Markup testing for WordPress using jQuery-style selectors.

105.8k2[1 issues](https://github.com/danielbachhuber/unholy/issues)PHP

Since Apr 11Pushed 10y ago2 watchersCompare

[ Source](https://github.com/danielbachhuber/unholy)[ Packagist](https://packagist.org/packages/danielbachhuber/unholy)[ RSS](/packages/danielbachhuber-unholy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Unholy
======

[](#unholy)

[![Build Status](https://camo.githubusercontent.com/b3d073d60e8ca0b2fdfb2529f188fe6ae6fcc14f58367ee76fa67b9f8ae52f04/68747470733a2f2f7472617669732d63692e6f72672f64616e69656c6261636868756265722f756e686f6c792e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/danielbachhuber/unholy)

Markup testing for WordPress using jQuery-style selectors. Uses PHPUnit, the WordPress Unit Test Suite, [QueryPath](http://querypath.org/), and [HTML5-PHP](http://masterminds.github.io/html5-php/).

It's unholy, but it works.

Installing
----------

[](#installing)

These instructions presuppose you're already using PHPUnit and the WordPress Unit Test Suite with your project. If you do, you can:

1. Require Unholy using Composer: `composer require danielbachhuber/unholy`
2. Install dependencies using Composer: `composer install`
3. Load Unholy into your test suite by appending `require dirname( dirname( __FILE__ ) ) . '/vendor/autoload.php';` to the end of your `bootstrap.php`.

Using
-----

[](#using)

The `Unholy_Testcase` class extends the `WP_UnitTestcase` class. Update your project's test classes to extend `Unholy_Testcase`.

Extending the `Unholy_Testcase` class exposes two helper methods: `get_permalink_as_dom()` and `get_feed_as_dom()`. These can be used to get a DOMDocument-esque object representing the view. Then, use the `qp()` function to navigate the object using jQuery-style selectors.

As an example, here is how you might test the Twenty Fifteen theme for the site title and description in the header:

```
