Last active
September 29, 2016 09:04
-
-
Save beyerz/de19687cbaeb5d15480a440f4100ddbd to your computer and use it in GitHub Desktop.
CodeShip Symfony2 Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################# | |
### Environment Script | |
################################# | |
# Set php version through phpenv. 5.3, 5.4 and 5.5 available | |
phpenv local 5.4 | |
# Modify xdebug settings and memory limit | |
echo "xdebug.max_nesting_level = 250" >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini | |
echo "memory_limit = 512M" >> $HOME/.phpenv/versions/$(phpenv version-name)/etc/php.ini | |
# Set Environment Vars for Symfony test | |
export SYMFONY_ENV=test | |
export SYMFONY__TEST_DATABASE_USER=$MYSQL_USER | |
export SYMFONY__TEST_DATABASE_PASSWORD=$MYSQL_PASSWORD | |
export SYMFONY__TEST_DATABASE_NAME=test | |
# Copy the parameters.yml.dist | |
cp app/config/parameters.yml.dist app/config/parameters.yml | |
# Install dependencies through Composer | |
composer install --prefer-source --no-interaction | |
# Drop and recreate Test-Database | |
php ./app/console --env=test doctrine:database:drop --force | |
php ./app/console --env=test doctrine:database:create | |
# Update Database-Schema | |
php ./app/console --env=test doctrine:schema:update --force | |
# Clear Cache | |
php ./app/console --env=test cache:clear | |
################################# | |
### Test Script | |
################################# | |
# Run PHPUnit Tests | |
vendor/bin/phpunit -c app/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment