Skip to content

w10t/assertions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

\Dxw\Assertions

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

About

Extra assertions for PHPUnit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%