Skip to content

Instantly share code, notes, and snippets.

@maxgaurav
Created July 6, 2016 11:21
Show Gist options
  • Save maxgaurav/ae16bb445ad736b4fd2a21275556117e to your computer and use it in GitHub Desktop.
Save maxgaurav/ae16bb445ad736b4fd2a21275556117e to your computer and use it in GitHub Desktop.
Codeship laravel project testing script
#This scripts installs and setups the eviornment for laravel with database and seeding
# We support all major PHP versions. Please see our docs for a full list
# https://codeship.com/documentation/languages/php/
#setting the phpenv
phpenv local 5.6
# Install dependencies through Composer
rm -f /home/rof/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
#setting the composer cache directory
COMPOSER_HOME=${HOME}/cache/composer
#installing dependencies
composer install --no-interaction
#createing env setting by copying the .env.testing to .env
cp .env.testing .env
#setting up laravel application
php artisan key:generate
php artisan migrate
php artisan db:seed
#starting local server for acceptance testing
#can use default laravel server or the php server
#php artisan serve --host=www.example.dev --port=8000 &
nohup bash -c "php -S www.example.dev:8000 2>&1 -t public &" && sleep 1; cat nohup.out
#This scripts runs the various test cases
#Running testcases for phpunit from laravel
composer exec phpunit
echo "Test Completed on phpunit"
echo "Proceeding to codeception unit test cases"
echo "Building codeception test cases"
composer exec codecept build
echo "Running codeception unit test cases"
composer exec codecept run unit
echo "Running codeception acceptance test cases"
composer exec codecept run acceptance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment