Skip to content

Commit

Permalink
Update to Composer Test Scenarios 3 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Dec 29, 2018
1 parent dfd8189 commit 99acef0
Show file tree
Hide file tree
Showing 23 changed files with 4,579 additions and 935 deletions.
57 changes: 57 additions & 0 deletions .scenarios.lock/install
@@ -0,0 +1,57 @@
#!/bin/bash

SCENARIO=$1
DEPENDENCIES=${2-install}

# Convert the aliases 'highest', 'lowest' and 'lock' to
# the corresponding composer command to run.
case $DEPENDENCIES in
highest)
DEPENDENCIES=update
;;
lowest)
DEPENDENCIES='update --prefer-lowest'
;;
lock|default|"")
DEPENDENCIES=install
;;
esac

original_name=scenarios
recommended_name=".scenarios.lock"

base="$original_name"
if [ -d "$recommended_name" ] ; then
base="$recommended_name"
fi

# If scenario is not specified, install the lockfile at
# the root of the project.
dir="$base/${SCENARIO}"
if [ -z "$SCENARIO" ] || [ "$SCENARIO" == "default" ] ; then
SCENARIO=default
dir=.
fi

# Test to make sure that the selected scenario exists.
if [ ! -d "$dir" ] ; then
echo "Requested scenario '${SCENARIO}' does not exist."
exit 1
fi

echo
echo "::"
echo ":: Switch to ${SCENARIO} scenario"
echo "::"
echo

set -ex

composer -n validate --working-dir=$dir --no-check-all --ansi
composer -n --working-dir=$dir ${DEPENDENCIES} --prefer-dist --no-scripts

# If called from a CI context, print out some extra information about
# what we just installed.
if [[ -n "$CI" ]] ; then
composer -n --working-dir=$dir info
fi
1 change: 1 addition & 0 deletions .scenarios.lock/phpunit4/.gitignore
@@ -0,0 +1 @@
vendor
Expand Up @@ -8,26 +8,25 @@
"email": "greg.1.anderson@greenknowe.org"
}
],
"autoload":{
"psr-4":{
"Consolidation\\Log\\": "src"
"autoload": {
"psr-4": {
"Consolidation\\Log\\": "../../src"
}
},
"autoload-dev": {
"psr-4": {
"Consolidation\\TestUtils\\": "tests/src"
"Consolidation\\TestUtils\\": "../../tests/src"
}
},
"require": {
"php": ">=5.5.0",
"psr/log": "~1.0"
"php": ">=5.4.5",
"psr/log": "^1.0",
"symfony/console": "^2.8|^3|^4"
},
"require-dev": {
"phpunit/phpunit": "4.*",
"g1a/composer-test-scenarios": "^1",
"satooshi/php-coveralls": "^2",
"squizlabs/php_codesniffer": "2.*",
"symfony/console": "^4.0"
"phpunit/phpunit": "^4.8.36",
"g1a/composer-test-scenarios": "^3",
"squizlabs/php_codesniffer": "^2"
},
"minimum-stability": "stable",
"scripts": {
Expand All @@ -42,11 +41,6 @@
"@lint",
"@unit",
"@cs"
],
"scenario": "scenarios/install",
"post-update-cmd": [
"create-scenario symfony4 'symfony/console:^4.0'",
"create-scenario symfony2 'symfony/console:^2.8' --platform-php '5.5' --no-lockfile"
]
},
"extra": {
Expand All @@ -56,8 +50,10 @@
},
"config": {
"platform": {

"php": "5.4.8"
},
"optimize-autoloader": true,
"sort-packages": true,
"vendor-dir": "../../vendor"
}
}

0 comments on commit 99acef0

Please sign in to comment.