run-tests.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env bash
  2. gpg --fingerprint D8406D0D82947747293778314AA394086372C20A
  3. if [ $? -ne 0 ]; then
  4. echo -e "\033[33mDownloading PGP Public Key...\033[0m"
  5. gpg --recv-keys D8406D0D82947747293778314AA394086372C20A
  6. # Sebastian Bergmann <sb@sebastian-bergmann.de>
  7. gpg --fingerprint D8406D0D82947747293778314AA394086372C20A
  8. if [ $? -ne 0 ]; then
  9. echo -e "\033[31mCould not download PGP public key for verification\033[0m"
  10. exit
  11. fi
  12. fi
  13. # Let's grab the latest release and its signature
  14. if [ ! -f phpunit.phar ]; then
  15. wget https://phar.phpunit.de/phpunit.phar
  16. fi
  17. if [ ! -f phpunit.phar.asc ]; then
  18. wget https://phar.phpunit.de/phpunit.phar.asc
  19. fi
  20. # Verify before running
  21. gpg --verify phpunit.phar.asc phpunit.phar
  22. if [ $? -eq 0 ]; then
  23. echo
  24. echo -e "\033[33mBegin Unit Testing\033[0m"
  25. # Run the testing suite
  26. php --version
  27. php phpunit.phar --configuration phpunit.xml.dist
  28. else
  29. echo
  30. chmod -x phpunit.phar
  31. mv phpunit.phar /tmp/bad-phpunit.phar
  32. mv phpunit.phar.asc /tmp/bad-phpunit.phar.asc
  33. echo -e "\033[31mSignature did not match! PHPUnit has been moved to /tmp/bad-phpunit.phar\033[0m"
  34. exit 1
  35. fi