PHP code example of phpfui / html-unit-tester

1. Go to this page and download the library: Download phpfui/html-unit-tester library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phpfui / html-unit-tester example snippets


class UnitTest extends \PHPFUI\HTMLUnitTester\Extensions
  {
  public function testValidHtml()
    {
    $this->assertValidHtml('<h1>Header</h1>');
    $this->assertValidHtmlPage('<!DOCTYPE html><html><head><meta charset="utf-8"/><title>Title</title></head><body><div>This is a test</div></body></html>');
    }
  }

  $this->assertDirectory('ValidCSS', 'cssDirectory', 'Invalid CSS');
  $this->assertDirectory('NotWarningCSS', 'cssDirectory', 'CSS has warnings');