Skip to content

Commit c1e793f

Browse files
committed
Test all files in a directory
1 parent 7556833 commit c1e793f

File tree

6 files changed

+1101
-3
lines changed

6 files changed

+1101
-3
lines changed

Diff for: README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[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.
44

5-
This package will check detect errors and warnings in HTML and CSS in stand alone strings, files or urls.
5+
This package will check detect errors and warnings in HTML and CSS in stand alone strings, files, entire directories or urls.
66
# Requirements
77
- PHP 7.1 or higher
88
- PHPUnit 7 or higher
@@ -51,6 +51,14 @@ You can use any of the following asserts:
5151
- assertValidHtml
5252
- assertValidUrl
5353

54+
## Directory Testing
55+
Instead of file by file testing, use **assertDirectory** to test an entire directory. Any files added to the directory will be automatically tested.
56+
```php
57+
$this->assertDirectory('ValidCSS', 'cssDirectory', 'Invalid CSS');
58+
$this->assertDirectory('NotWarningCSS', 'cssDirectory', 'CSS has warnings');
59+
```
60+
The error message will include the offending file name.
61+
5462
## Examples
5563
See [examples](https://github.com/phpfui/HTMLUnitTester/blob/master/tests/UnitTest.php)
5664

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"rexxars/html-validator": "^2.2"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "~7.0"
19+
"phpunit/phpunit": "^7.0|>=8.0"
2020
},
2121
"autoload": {
2222
"psr-0": {"PHPFUI": "src/"}

0 commit comments

Comments
 (0)