dxw / assertions
Extra assertions for PHPUnit
Installs: 9 514
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 13
Forks: 1
Open Issues: 6
Requires
- masterminds/html5: 2.*
- wa72/html-pretty-min: ^0.1.4
Requires (Dev)
- phpunit/phpunit: 4.8.*
This package is auto-updated.
Last update: 2020-08-31 00:42:49 UTC
README
Installation
composer require --dev dxw/assertions=dev-master
Usage
class MyTest extends PHPUnit_Framework_TestCase
{
use \Dxw\Assertions\HTML;
public function testSomeHtml()
{
$output = '<a href="aaa">bbb</a>';
// Assert the two documents are equivalent
$this->assertHTMLEquals('
<a href="aaa" >bbb</a>
', $output);
// Be strict about whitespace
$this->assertHTMLEqualsStrictWhitespace('
<a href="aaa" >
bbb
</a>
', $output);
}
}
API
\Dxw\Assertions\HTML
assertHTMLEquals($expected, $actual)
assertHTMLEqualsStrictWhitespace($expected, $actual)