Download the PHP package phpfui/html-unit-tester without Composer
On this page you can find all versions of the php package phpfui/html-unit-tester. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phpfui/html-unit-tester
More information about phpfui/html-unit-tester
Files in phpfui/html-unit-tester
Package html-unit-tester
Short Description PHPUnit Testing extensions for HMTL and CSS insures valid HTML and CSS via v.Nu validator
License MIT
Homepage https://github.com/phpfui/HTMLUnitTester
Informations about the package html-unit-tester
PHPFUI\HTMLUnitTester
PHPUnit Testing extensions for HMTL and CSS. PHPFUI\HTMLUnitTester allows you to unit test HTML and CSS for errors and warnings. Often simple errors in HTML or CSS create hard to debug issues where a simple check will reveal bad code.
This package will check detect errors and warnings in HTML and CSS in stand alone strings, files, entire directories or urls.
For the best performanance, a local install of https://github.com/validator/validator is recommended.
Installation
Configuration
It is recommended you run https://github.com/validator/validator locally. Install Java and download the .jar file. Run with the following command:
To run unit tests with GitHub Actions, add the following lines to you workflows test yml file:
Usage
Extend your unit tests from \PHPFUI\HTMLUnitTester\Extensions
You can use any of the following asserts:
- assertNotWarningCss
- assertNotWarningCssFile
- assertNotWarningCssUrl
- assertNotWarningFile
- assertNotWarningHtml
- assertNotWarningHtmlPage
- assertNotWarningUrl
- assertValidCss
- assertValidCssFile
- assertValidCssUrl
- assertValidFile
- assertValidHtml
- assertValidHtmlPage
- assertValidUrl
Directory Testing
Instead of file by file testing, use assertDirectory to test an entire directory. Any files added to the directory will be automatically tested.
The error message will include the offending file name.
Examples
See examples
Documentation
Full documentation at PHPFUI\HTMLUnitTester
License
PHPFUI\HTMLUnitTester is distributed under the MIT License.
PHP Versions
This library only supports modern versions of PHP which still receive security updates. While we would love to support PHP from the late Ming Dynasty, the advantages of modern PHP versions far out weigh quaint notions of backward compatibility. Time to upgrade.