Download "user manual"

Transcript
Unit Tests
classes. In turn, client_CartoserverServiceTest extends other
classes which offer additional helpful methods. For the complete list of
available methods, please have a look at the generate API docs (as more
may be added in future). The main useful methods are
createRequest() for initializing a new request, getMap() for
lanching the request.
Tip
Having a look at an existing plugin test case is the best starting point for
writing new tests.
6.3. Running Tests
Running tests is possible in two different ways:
1.
With command line.
2.
Through the web interface.
6.3.1. Command Line Interface
To run a test case or a test suite, type the following command in directory
<cartoweb3_root>/tests:
<php-bin> phpunit.php <test-class>
Where <php-bin> is the PHP binary and <test-class> is the name of the test
class (AllTests, client_AllTests, client_CartoclientTest, etc.).
Result should look like this:
PHPUnit 2.0.3 by Sebastian Bergmann.
.......F.....
Time: 0.0410950183868
There was 1 failure:
1) testpointtobbox
expected same: <113> was not: <123>
/home/yves/cartoweb3-proto2/tests/common/BasicTypesTest.php:59
/home/yves/cartoweb3-proto2/tests/phpunit.php:24
FAILURES!!!
Tests run: 12, Failures: 1, Errors: 0, Incomplete Tests: 0.
Content-type: text/html
X-Powered-By: PHP/5.0.1
In this case, 12 tests were run with one failure.
168