-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #411 from Restless-ET/master
Created helpful bash script for running tests locally.
- Loading branch information
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ Tests/autoload.php | |
nbproject | ||
catalog.xml | ||
.idea | ||
composer.phar | ||
composer.lock | ||
vendor/* | ||
!vendor/vendors.php |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
# | ||
|
||
SUPPORTED_SYMFONY_VERSIONS=('~2.3.0' '~2.5.0' '~2.6.0' '~2.7.0' '2.8.x-dev') | ||
DOCTRINE_VERSION=">=2.2.3,<2.5-dev" | ||
|
||
restore_composer (){ | ||
# Restore the composer.json file | ||
rm composer.json && mv composer.json.bck composer.json | ||
} | ||
|
||
# Install/upgrade composer.phar | ||
curl -sS https://getcomposer.org/installer | php | ||
php composer.phar --version | ||
|
||
# Save a copy of the current composer.json file so we can restore it later | ||
cp composer.json composer.json.bck | ||
|
||
# Clear temp folder before the tests run | ||
rm -rf /tmp/VichUploaderBundle/ | ||
|
||
# If SYMFONY_VERSION is set run the tests only for that version | ||
if [ "${SYMFONY_VERSION}" != "" ]; then | ||
SUPPORTED_SYMFONY_VERSIONS=(${SYMFONY_VERSION}) | ||
fi | ||
|
||
# Run the tests for each supported symfony version | ||
for sf_version in ${SUPPORTED_SYMFONY_VERSIONS[@]}; do | ||
echo -e "\n\nSetting requirements version constraints: Symfony (${sf_version}) and Doctrine (${DOCTRINE_VERSION})" | ||
php composer.phar require --no-update "symfony/symfony":"${sf_version}" | ||
php composer.phar require --no-update "doctrine/orm":"${DOCTRINE_VERSION}" | ||
|
||
echo -e "\nInstalling dependencies" | ||
php composer.phar update --prefer-source || { restore_composer && exit 1; } | ||
|
||
echo -e "\nLaunching tests" | ||
vendor/bin/phpunit $@ | ||
done | ||
|
||
restore_composer |