install-local-phpunit.sh 785 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. echo "Starting to install dependencies"
  3. echo
  4. PEAR_CONFIG_FILE=".pearrc"
  5. # clean up prior installation
  6. rm -rf pear $PEAR_CONFIG_FILE || exit 1
  7. # make new local config
  8. pear config-create $(pwd)/ $PEAR_CONFIG_FILE || exit 1
  9. pear -c $PEAR_CONFIG_FILE config-set auto_discover 1 || exit 1
  10. pear -c $PEAR_CONFIG_FILE channel-discover pear.phpunit.de || exit 1
  11. pear -c $PEAR_CONFIG_FILE install phpunit/PHPUnit || exit 1
  12. # patch PHP's include_path in phpunit script
  13. PEAR_DIR=$(pwd)/pear
  14. sed '2a\
  15. set_include_path(dirname(__FILE__) . "/php" . PATH_SEPARATOR . get_include_path());
  16. ' $PEAR_DIR/phpunit > $PEAR_DIR/phpunit2 || exit 1
  17. mv $PEAR_DIR/phpunit2 $PEAR_DIR/phpunit || exit 1
  18. chmod 755 $PEAR_DIR/phpunit || exit 1
  19. cd $ORIG_DIR
  20. echo
  21. echo "Done installing dependencies"