2017 © Pedro Peláez
 

library htmlunit

Enables you to thoroughly test the HTML output of your code.

image

bootpress/htmlunit

Enables you to thoroughly test the HTML output of your code.

  • Thursday, January 19, 2017
  • by BootPress
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,429 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

use BootPress\HTMLUnit\Component as HTMLUnit;

Packagist ![License MIT][badge-license] HHVM Tested ![PHP 7 Supported][badge-php] Build Status ![Code Climate][badge-code-climate] Test Coverage, (*1)

Extends PHPUnit and combines the assertEquals and assertRegExp assertions into one assertEqualsRegExp method that enables you to thoroughly test the HTML output of your code., (*2)

Installation

Add the following to your composer.json file., (*3)

``` bash { "require-dev": { "bootpress/htmlunit": "^1.0" } }, (*4)


## Example Usage ``` php <?php class MyTest extends \BootPress\HTMLUnit\Component { public function testOutput() { $html = <<<'EOT' <!doctype html> <html lang="en-us"> <head><meta charset="UTF-8"> <title>Title</title></head> <body> <p>Content</p> </body> </html> EOT; $this->assertEqualsRegExp(array( '<!doctype {{ [^>]+ }}>', '<html lang="{{ [a-z-]+ }}">', '<head>', '<meta charset="{{ [A-Z0-9-]+ }}">', '<title>Title</title>', '</head>', '<body>', '

Content, (*5)

', '</body>', '</html>', ), $html); } }

Notice that all of the whitespace surrounding the array values are ignored. Regular expressions are enclosed Twig style {{ ... }} with two curly braces and a space on both ends. Internally the regex is wrapped like so: /^...$/., (*6)

License

The MIT License (MIT). Please see License File for more information., (*7)

The Versions

19/01 2017

dev-master

9999999-dev

Enables you to thoroughly test the HTML output of your code.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyle Gadd

phpunit xml html tests assertions bootpress

01/09 2016

v1.0

1.0.0.0

Enables you to thoroughly test the HTML output of your code.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyle Gadd

phpunit xml html tests assertions bootpress