Skip to content

Commit

Permalink
Test all files in a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
phpfui committed Aug 13, 2020
1 parent 7556833 commit c1e793f
Show file tree
Hide file tree
Showing 6 changed files with 1,101 additions and 3 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[PHPUnit](https://phpunit.de/) 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 or urls.
This package will check detect errors and warnings in HTML and CSS in stand alone strings, files, entire directories or urls.
# Requirements
- PHP 7.1 or higher
- PHPUnit 7 or higher
Expand Down Expand Up @@ -51,6 +51,14 @@ You can use any of the following asserts:
- assertValidHtml
- 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.
```php
$this->assertDirectory('ValidCSS', 'cssDirectory', 'Invalid CSS');
$this->assertDirectory('NotWarningCSS', 'cssDirectory', 'CSS has warnings');
```
The error message will include the offending file name.

## Examples
See [examples](https://github.com/phpfui/HTMLUnitTester/blob/master/tests/UnitTest.php)

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"rexxars/html-validator": "^2.2"
},
"require-dev": {
"phpunit/phpunit": "~7.0"
"phpunit/phpunit": "^7.0|>=8.0"
},
"autoload": {
"psr-0": {"PHPFUI": "src/"}
Expand Down
Loading

0 comments on commit c1e793f

Please sign in to comment.