Skip to content

Instantly share code, notes, and snippets.

@aapis
Created December 15, 2015 18:42
Show Gist options
  • Save aapis/4f8394b61b310aaafbcc to your computer and use it in GitHub Desktop.
Save aapis/4f8394b61b310aaafbcc to your computer and use it in GitHub Desktop.
Symfony test/build commands (for use in local development)
# Really simple wrappers for running PHPUnit and testing your app's endpoints
# Usage
# run_phpunit Path/To/Bundle
run_phpunit(){
local bundle=$1
local config="app/phpunit.xml.dist"
if [ -f $config ]
then
phpunit src/$bundle/Tests -c $config
else
echo "File not found: $config"
fi
}
# Usage
# test_endpoint save "test=1&test2=['derp','herp','qwop']"
test_endpoint(){
local endpoint=$1
local data=$2
curl -X POST http://localhost:8000/$endpoint --data $data && echo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment