run-api-tests.sh 471 B

123456789101112131415161718
  1. #!/usr/bin/env sh
  2. export APP_ENV=test
  3. export DB_DRIVER=mysql
  4. # Try to stop server just in case it hanged in last execution
  5. vendor/bin/mezzio-swoole stop
  6. echo 'Starting server...'
  7. vendor/bin/mezzio-swoole start -d
  8. sleep 2
  9. vendor/bin/phpunit --order-by=random -c phpunit-api.xml --testdox --colors=always $*
  10. testsExitCode=$?
  11. vendor/bin/mezzio-swoole stop
  12. # Exit this script with the same code as the tests. If tests failed, this script has to fail
  13. exit $testsExitCode