PHPackages                             phug/tester - 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. [Templating &amp; Views](/categories/templating)
4. /
5. phug/tester

ActiveLibrary[Templating &amp; Views](/categories/templating)

phug/tester
===========

Test and coverage utils for Pug (ex-Jade) templates rendered with the Phug engine

1.0.0(6y ago)1321MITPHPPHP &gt;=7.1.0

Since Apr 4Pushed 6y ago2 watchersCompare

[ Source](https://github.com/phug-php/tester)[ Packagist](https://packagist.org/packages/phug/tester)[ Docs](http://phug-lang.com)[ RSS](/packages/phug-tester/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

Phug Tester
===========

[](#phug-tester)

What is Phug Tester?
--------------------

[](#what-is-phug-tester)

The Phug tester allow you to write unit tests easily for your Phug templates and get coverage of your tests.

As a [PHPUnit](https://phpunit.de/) extension, you can use all the features, options and same code you use usually running `phpunit` when your run the `phug-tester` command.

Installation
------------

[](#installation)

Install via Composer

```
composer require phug/tester
```

Requirements:

- PHP &gt;= 7.0
- [XDebug PHP extension](https://xdebug.org/)
- [PHPUnit](https://phpunit.de/) &gt;= 5.7 (installed automatically via composer)

Usage
-----

[](#usage)

```
./vendor/bin/phug-tester --pug-coverage-threshold=90 --pug-coverage-text --pug-coverage-html=coverage/pug
```

You can couple it with PHP coverage data as phug-tester use PHPUnit and is compatible with all its options:

```
./vendor/bin/phug-tester --coverage-text --pug-coverage-text --coverage-html=coverage --pug-coverage-html=coverage/pug
```

This will output in the CLI both PHP and Pug coverage summaries and it will dump as HTML PHP coverage in the directory **coverage** and Pug coverage in the sub-directory **coverage/pug**.

```
