Skip to content

Commit

Permalink
Add more test scenarios giving g1a/composer-test-scenarios a try
Browse files Browse the repository at this point in the history
  • Loading branch information
robertfausk committed Mar 29, 2020
1 parent 44ba5f7 commit ccc934c
Show file tree
Hide file tree
Showing 8 changed files with 236 additions and 11 deletions.
61 changes: 61 additions & 0 deletions .scenarios.lock/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

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

# Convert the aliases 'highest', 'lowest' and 'lock' to
# the corresponding composer update command to run.
case $DEPENDENCIES in
highest)
UPDATE_COMMAND=update
;;
lowest)
UPDATE_COMMAND='update --prefer-lowest'
;;
lock|default|"")
UPDATE_COMMAND=''
;;
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

if [ ! -z "$UPDATE_COMMAND" ] ; then
composer -n --working-dir=$dir ${UPDATE_COMMAND} --prefer-dist --no-scripts
fi
composer -n --working-dir=$dir install --prefer-dist

# 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/symfony3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor
51 changes: 51 additions & 0 deletions .scenarios.lock/symfony3/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "robertfausk/behat-panther-extension",
"type": "behat-extension",
"description": "Symfony Panther extension for Behat",
"keywords": [
"behat",
"symfony",
"panther",
"web",
"test",
"browser",
"gui"
],
"license": "MIT",
"authors": [
{
"name": "Robert Freigang",
"email": "[email protected]"
}
],
"require": {
"symfony/config": "^3.4",
"php": ">=7.1",
"behat/behat": "^3.0.5",
"behat/mink-extension": "^2.0",
"robertfausk/mink-panther-driver": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "~7.5",
"matthiasnoback/symfony-config-test": "^4.1",
"g1a/composer-test-scenarios": "^3.0"
},
"autoload": {
"psr-0": {
"Robertfausk\\Behat\\PantherExtension": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "../../tests/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"config": {
"vendor-dir": "../../vendor"
}
}
1 change: 1 addition & 0 deletions .scenarios.lock/symfony4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor
51 changes: 51 additions & 0 deletions .scenarios.lock/symfony4/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "robertfausk/behat-panther-extension",
"type": "behat-extension",
"description": "Symfony Panther extension for Behat",
"keywords": [
"behat",
"symfony",
"panther",
"web",
"test",
"browser",
"gui"
],
"license": "MIT",
"authors": [
{
"name": "Robert Freigang",
"email": "[email protected]"
}
],
"require": {
"symfony/config": "^4.0",
"php": ">=7.1",
"behat/behat": "^3.0.5",
"behat/mink-extension": "^2.0",
"robertfausk/mink-panther-driver": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "~7.5",
"matthiasnoback/symfony-config-test": "^4.1",
"g1a/composer-test-scenarios": "^3.0"
},
"autoload": {
"psr-0": {
"Robertfausk\\Behat\\PantherExtension": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "../../tests/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"config": {
"vendor-dir": "../../vendor"
}
}
30 changes: 21 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,40 @@ sudo: false
php: [7.1, 7.2, 7.3, 7.4]

matrix:
allow_failures:
- env: DEPENDENCIES='dev'
- php: 7.4
fast_finish: true
include:
# Test against dev versions of dependencies
- php: 7.4
env: DEPENDENCIES='dev'
env: 'SCENARIO=symfony4 DEPENDENCIES=highest'
- php: 7.4
env: 'SCENARIO=symfony4 DEPENDENCIES=lowest'
- php: 7.4
env: 'SCENARIO=symfony3'
- php: 7.3
env: 'SCENARIO=symfony4'
- php: 7.3
env: 'SCENARIO=symfony3'
- php: 7.2
env: 'SCENARIO=symfony4'
- php: 7.2
env: 'SCENARIO=symfony3'
- php: 7.1
env: 'SCENARIO=symfony4'
- php: 7.1
env: 'SCENARIO=symfony3 DEPENDENCIES=highest'
- php: 7.1
env: 'SCENARIO=symfony3 DEPENDENCIES=lowest'
cache:
directories:
- $HOME/.composer/cache/files

before_install:
- if [ "$DEPENDENCIES" = "dev" ]; then composer config minimum-stability dev; fi;

install:
- composer install --no-progress
- '.scenarios.lock/install "${SCENARIO}" "${DEPENDENCIES}"'

script:
- vendor/bin/phpunit -v --coverage-clover=coverage.clover
- vendor/bin/behat --config=tests/Behat/behat.yml

after_script:
- travis_retry php vendor/bin/coveralls -v
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
37 changes: 36 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Robert Freigang
Copyright (c) 2019-2020 Robert Freigang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,3 +19,38 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

DEPENDENCY LICENSES:

Name Version License
behat/behat v3.6.1 MIT
behat/gherkin v4.6.2 MIT
behat/mink v1.8.1 MIT
behat/mink-extension 2.3.1 MIT
behat/transliterator v1.3.0 Artistic-1.0
container-interop/container-interop 1.2.0 MIT
php-webdriver/webdriver 1.8.2 MIT
psr/container 1.0.0 MIT
psr/log 1.1.3 MIT
robertfausk/mink-panther-driver v1.0.3 MIT
symfony/browser-kit v5.0.6 MIT
symfony/config v3.4.38 MIT
symfony/console v4.4.6 MIT
symfony/css-selector v5.0.6 MIT
symfony/dependency-injection v4.0.15 MIT
symfony/dom-crawler v5.0.6 MIT
symfony/event-dispatcher v4.4.6 MIT
symfony/event-dispatcher-contracts v1.1.7 MIT
symfony/filesystem v4.4.6 MIT
symfony/http-client v5.0.6 MIT
symfony/http-client-contracts v2.0.1 MIT
symfony/panther v0.7.1 MIT
symfony/polyfill-ctype v1.15.0 MIT
symfony/polyfill-mbstring v1.15.0 MIT
symfony/polyfill-php72 v1.15.0 MIT
symfony/polyfill-php73 v1.15.0 MIT
symfony/process v5.0.6 MIT
symfony/service-contracts v2.0.1 MIT
symfony/translation v4.4.6 MIT
symfony/translation-contracts v2.0.1 MIT
symfony/yaml v5.0.6 MIT
15 changes: 14 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
},
"require-dev": {
"phpunit/phpunit": "~7.5",
"matthiasnoback/symfony-config-test": "^4.1"
"matthiasnoback/symfony-config-test": "^4.1",
"g1a/composer-test-scenarios": "^3.0"
},
"autoload": {
"psr-0": {
Expand All @@ -42,6 +43,18 @@
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
},
"scenarios": {
"symfony4": {
"require": {
"symfony/config": "^4.0"
}
},
"symfony3": {
"require": {
"symfony/config": "^3.4"
}
}
}
}
}

0 comments on commit ccc934c

Please sign in to comment.