Chris@12: #!/bin/bash Chris@0: set -e Chris@0: Chris@0: start_browser_api(){ Chris@0: CURRENT_DIR=$(pwd) Chris@0: LOCAL_PHANTOMJS="${CURRENT_DIR}/bin/phantomjs" Chris@0: if [ -f ${LOCAL_PHANTOMJS} ]; then Chris@0: ${LOCAL_PHANTOMJS} --ssl-protocol=any --ignore-ssl-errors=true vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768 2>&1 & Chris@0: else Chris@0: phantomjs --ssl-protocol=any --ignore-ssl-errors=true vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768 2>&1 >> /dev/null & Chris@0: fi Chris@0: sleep 2 Chris@0: } Chris@0: Chris@0: stop_services(){ Chris@0: ps axo pid,command | grep phantomjs | grep -v grep | awk '{print $1}' | xargs -I {} kill {} Chris@12: ps axo pid,command | grep php | grep -v grep | grep -v phpstorm | grep -v php-fpm | awk '{print $1}' | xargs -I {} kill {} Chris@0: sleep 2 Chris@0: } Chris@0: Chris@12: start_local_browser(){ Chris@0: CURRENT_DIR=$(pwd) Chris@12: ${CURRENT_DIR}/bin/mink-test-server > /dev/null 2>&1 & Chris@0: sleep 2 Chris@0: } Chris@0: Chris@12: function finish() { Chris@12: stop_services Chris@12: if [ -z "$MINK_STOP_BROWSER" ]; then Chris@12: start_browser_api Chris@12: fi Chris@12: } Chris@12: Chris@12: trap finish EXIT Chris@12: Chris@0: mkdir -p /tmp/jcalderonzumba/phantomjs Chris@12: stop_services || true Chris@0: start_browser_api Chris@12: start_local_browser Chris@0: cd ${CURRENT_DIR} Chris@0: ${CURRENT_DIR}/bin/phpunit --configuration integration_tests.xml