Phlickr ships with a set of unit tests to verify its functionality. The unit tests are divided into two separate suites, offline and online. The unit tests are written using PHPUnit2.
On UNIX systems you'll need to be case sensitive, on Windows everything gets forced to lowercase.
Installing PHPUnit2
To install PHPUnit2 and its dependencies it's best to use the PEAR installer:
pear install -a PHPUnit2Figuring out where the tests are
If you installed Phlickr using the PEAR installer the unit tests were installed into PEAR's tests directory. You can determine what this directory is using the following command:
$ pear config-get test_dir
/usr/local/lib/php/pear/testsC:\>pear config-get test_dir
C:\PHP\pear\testsIt's unlikely that this directory is in PHP's include path but you can check using the following command:
$ php -r "print get_include_path();"
.:/usr/local/share/pear/:/usr/local/lib/php/pear:/usr/local/share/smartyC:\>php -r "print get_include_path();"
.;c:\php\includes;C:\PHP\pearRunning the tests
If the tests directory isn't in the include path it's easiest to use PHP to load the test suite:
$ php /usr/local/lib/php/pear/tests/Phlickr/Tests/AllTests.php
PHPUnit 2.2.0 by Sebastian Bergmann.
.........................................
.........................................
.........................................
.........................................
.........................................
..............................
Time: 35.034182
OK (235 tests)$ php c:\PHP\PEAR\tests\Phlickr\Tests\AllTests.php
PHPUnit 2.2.0 by Sebastian Bergmann.
.........................................
.........................................
.........................................
.........................................
.........................................
..............................
Time: 35.034182
OK (235 tests)If PEAR's tests directory is in the include path you can call PHPUnit with the class name and it will load and run it:
$ phpunit Phlickr_Tests_AllTestsC:\>phpunit phlickr_tests_offline_alltests
Installing PHPUnit2
I would like to say you thanks for details because I have also joined the php classed after the 650-575 and 220-601. I will try it and hope that will surely work for me.In fact I am really inspired by this wonderful blog and also have sent the link to my many other friends because this one is a good one to read out.