dxw/assertions

This package is abandoned and no longer maintained. No replacement package was suggested.

Extra assertions for PHPUnit

dev-master 2016-04-22 20:21 UTC

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)

Licence

MIT