https://github.com/irukasano/phpunit-htmlhint
add assertion of phpunit with htmlhint
https://github.com/irukasano/phpunit-htmlhint
htmlhint phpunit
Last synced: 23 days ago
JSON representation
add assertion of phpunit with htmlhint
- Host: GitHub
- URL: https://github.com/irukasano/phpunit-htmlhint
- Owner: irukasano
- License: mit
- Created: 2022-08-15T02:18:48.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-16T04:10:10.000Z (almost 4 years ago)
- Last Synced: 2025-11-27T15:13:54.927Z (8 months ago)
- Topics: htmlhint, phpunit
- Language: PHP
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# phpunit-htmlhint
add phpunit assertion by htmlhint
## install
install this library,
```bash
$ composer require irukasano/phpunit-htmlhint
```
and also needs to install [htmlhint](https://htmlhint.com/docs/user-guide/getting-started)
```bash
$ sudo apt install nodejs npm
$ sudo npm install n -g
$ sudo n stable
$ sudo npm install htmlhint -g
```
## usage
### cakephp3
in your testcase ( ex. tests/TestCase/PagesControllerTest.php ),
```php
use PHPUnitHmtlhint\LintTestTrait;
class PagesControllerTest extends TestCase
{
use IntegrationTestTrait;
use LintTestTrait;
public function test()
{
$this->get('/');
$html = $this->_response->getBody();
$this->assertHtmlhintOk($html);
}
}
```