Advertisement
dragonbe

Official ZF readme for unit testing

Oct 2nd, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. This version of PHPUnit is not supported in Zend Framework 1.x unit tests.
  2.  
  3. To install PHPUnit 3.4:
  4.  
  5. sudo pear config-set auto_discover 1
  6. sudo pear install --installroot /usr/local/phpunit34 pear.phpunit.de/PHPUnit-3.4.15
  7.  
  8. This will install PHPUnit-3.4.15 to /usr/local/phpunit34.
  9.  
  10.  
  11. Now edit /usr/local/phpunit34/usr/bin/phpunit. Before the first
  12. require_once statement in that file, enter the following code:
  13.  
  14. set_include_path(implode(PATH_SEPARATOR, array(
  15. __DIR__ . '/../share/php',
  16. '/usr/share/php',
  17. get_include_path()
  18. )));
  19.  
  20. Note the actual directory (share/php in the code above) depends on your
  21. particular installation. The correct path can be found by typing:
  22.  
  23. pear config-show|grep php_dir
  24.  
  25. (on Centos it is share/php, on Ubuntu/Debian it is share/pear and on
  26. OS X it is lib/php/pear)
  27.  
  28.  
  29. Lastly, we need a symlink:
  30.  
  31. sudo ln -s /some/path/phpunit34/usr/bin/phpunit /usr/bin/phpunit34
  32.  
  33. Now you can run the unit tests with:
  34.  
  35. phpunit34 --stderr -d memory_limit=-1 Zend/{Name}/AllTests.php
  36.  
  37. (Based on information from Christer Edvartsen's article published at
  38. http://tech.vg.no/2011/11/29/running-multiple-versions-of-phpunit/)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement