Table of Contents
The How To Test Guide.
This project uses pear package PHPUnit to run the unit tests. See the PHPUnit web site [PHPUNIT-DE] for more details on how to use it.
By all tests we mean, all tests that don't need require connection.
cd tests phpunit --verbose AllTests
The test suites are in the tests directory and have names ending
with Test.php
by convention.
cd tests phpunit FileIWantToTest.php
By all tests we mean, all tests that don't need require connection.
cd tests phpunit --verbose AllTests
The network test requires an Apache setup on a server with doc
patch pointing to the distribution files. Because of this, it is not a
part of the larger test suite. The test is identical to
tests/restNarutoTest.php
except in this test a real
network connection is used.
Determine your URL path to tests/testRestServer.php on the
server. It should be something like
http://localhost/naruto/tests/testRestServer.php
.
Try it in your browser.
On the client machine, set the environment variable SERVICE_URL to that url.
export SERVICE_URL=http://localhost/naruto/tests/testRestServer.php
Run the test tests/restNarutoNetTest.php
using php unit.
cd tests phpunit restNarutoNetTest.php