phpunit
is widely used to unit-test PHP
code. Using the PHP
built-in
server, it can be used to run End-to-End, Functional and Black Box tests
(see #9), #15, #20 here)
to verify that your application is behaving as expected and that the rendered
output is correct. It is a viable alternative to more complex testing tools, such as
Selenium Web Driver
, for simple web applications or even static websites
(static content needs validation too).
test/StaticPagesTest.php
Test for staticHTML
pagestest/DynamicPagesTest.php
Test for dynamicPHP
pagestest/RoutesTest.php
Test for dynamically routed pages
Clone the repository, then run:
$ composer install
Run:
$ ./vendor/bin/phpunit
Remove the .skip_this
extension from:
then run:
$ ./vendor/bin/phpunit