diff --git a/.scenarios.lock/install b/.scenarios.lock/install new file mode 100755 index 0000000..4d8a777 --- /dev/null +++ b/.scenarios.lock/install @@ -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 diff --git a/.scenarios.lock/symfony3/.gitignore b/.scenarios.lock/symfony3/.gitignore new file mode 100644 index 0000000..5657f6e --- /dev/null +++ b/.scenarios.lock/symfony3/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/.scenarios.lock/symfony3/composer.json b/.scenarios.lock/symfony3/composer.json new file mode 100644 index 0000000..6f27c61 --- /dev/null +++ b/.scenarios.lock/symfony3/composer.json @@ -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": "robertfreigang@gmx.de" + } + ], + "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" + } +} diff --git a/.scenarios.lock/symfony4/.gitignore b/.scenarios.lock/symfony4/.gitignore new file mode 100644 index 0000000..5657f6e --- /dev/null +++ b/.scenarios.lock/symfony4/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/.scenarios.lock/symfony4/composer.json b/.scenarios.lock/symfony4/composer.json new file mode 100644 index 0000000..f19d684 --- /dev/null +++ b/.scenarios.lock/symfony4/composer.json @@ -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": "robertfreigang@gmx.de" + } + ], + "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" + } +} diff --git a/.travis.yml b/.travis.yml index 6ad14af..e0b1c38 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/LICENSE b/LICENSE index 779c58d..2cd3d0e 100644 --- a/LICENSE +++ b/LICENSE @@ -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 @@ -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 \ No newline at end of file diff --git a/composer.json b/composer.json index 478d0ab..aacb747 100644 --- a/composer.json +++ b/composer.json @@ -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": { @@ -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" + } + } } } }