diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7bee0f2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,59 @@ +name: CI + +on: + push: + pull_request: + +defaults: + run: + shell: bash + +jobs: + + tests: + name: Tests + runs-on: ubuntu-20.04 + strategy: + matrix: + php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ] + symfony: ['symfony3', 'symfony4', 'symfony5'] + include: + - php: '8.0' + symfony: 'symfony6' + - php: '8.1' + symfony: 'symfony6' + fail-fast: false + env: + MATRIX_PHP: ${{ matrix.php }} + MATRIX_SYMFONY: ${{ matrix.symfony }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + coverage: "none" + php-version: "${{ matrix.php }}" + tools: composer + - name: Install scenario + run: | + .scenarios.lock/install "${{ matrix.symfony }}" "${DEPENDENCIES}" + - name: Add browser drivers + run: | + vendor/bin/bdi detect drivers + - name: Run unit tests + run: | + vendor/bin/phpunit -v + - name: Run behat tests + run: | + vendor/bin/behat --config=tests/Behat/behat.yml + - name: Archive logs artifacts + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: logs_php-${{ matrix.php }} + path: | + logs diff --git a/.scenarios.lock/symfony3/composer.json b/.scenarios.lock/symfony3/composer.json index 4ae724e..e296bdf 100644 --- a/.scenarios.lock/symfony3/composer.json +++ b/.scenarios.lock/symfony3/composer.json @@ -20,16 +20,17 @@ ], "require": { "symfony/config": "^3.4", - "php": ">=7.1", + "php": ">=7.2", "behat/behat": "^3.0.5", "robertfausk/mink-panther-driver": "^1.0", "friends-of-behat/mink-extension": "^2.3.0" }, "require-dev": { - "roave/security-advisories": "dev-master", - "phpunit/phpunit": "~7.5|~9.3", + "dbrekelmans/bdi": "^1.0", + "g1a/composer-test-scenarios": "^3.0", "matthiasnoback/symfony-config-test": "^4.1", - "g1a/composer-test-scenarios": "^3.0" + "phpunit/phpunit": "~7.5|~9.3", + "roave/security-advisories": "dev-master" }, "autoload": { "psr-4": { @@ -43,6 +44,10 @@ }, "config": { "sort-packages": true, + "allow-plugins": { + "g1a/composer-test-scenarios": true, + "pyrech/composer-changelogs": true + }, "vendor-dir": "../../vendor" }, "extra": { diff --git a/.scenarios.lock/symfony4/composer.json b/.scenarios.lock/symfony4/composer.json index 2e76cac..ff3d5cb 100644 --- a/.scenarios.lock/symfony4/composer.json +++ b/.scenarios.lock/symfony4/composer.json @@ -20,16 +20,17 @@ ], "require": { "symfony/config": "^4.0", - "php": ">=7.1", + "php": ">=7.2", "behat/behat": "^3.0.5", "robertfausk/mink-panther-driver": "^1.0", "friends-of-behat/mink-extension": "^2.3.0" }, "require-dev": { - "roave/security-advisories": "dev-master", - "phpunit/phpunit": "~7.5|~9.3", + "dbrekelmans/bdi": "^1.0", + "g1a/composer-test-scenarios": "^3.0", "matthiasnoback/symfony-config-test": "^4.1", - "g1a/composer-test-scenarios": "^3.0" + "phpunit/phpunit": "~7.5|~9.3", + "roave/security-advisories": "dev-master" }, "autoload": { "psr-4": { @@ -43,6 +44,10 @@ }, "config": { "sort-packages": true, + "allow-plugins": { + "g1a/composer-test-scenarios": true, + "pyrech/composer-changelogs": true + }, "vendor-dir": "../../vendor" }, "extra": { diff --git a/.scenarios.lock/symfony5/composer.json b/.scenarios.lock/symfony5/composer.json index 3fa701f..fda3a7c 100644 --- a/.scenarios.lock/symfony5/composer.json +++ b/.scenarios.lock/symfony5/composer.json @@ -20,16 +20,17 @@ ], "require": { "symfony/config": "^5.0", - "php": ">=7.1", + "php": ">=7.2", "behat/behat": "^3.0.5", "robertfausk/mink-panther-driver": "^1.0", "friends-of-behat/mink-extension": "^2.3.0" }, "require-dev": { - "roave/security-advisories": "dev-master", - "phpunit/phpunit": "~7.5|~9.3", + "dbrekelmans/bdi": "^1.0", + "g1a/composer-test-scenarios": "^3.0", "matthiasnoback/symfony-config-test": "^4.1", - "g1a/composer-test-scenarios": "^3.0" + "phpunit/phpunit": "~7.5|~9.3", + "roave/security-advisories": "dev-master" }, "autoload": { "psr-4": { @@ -43,6 +44,10 @@ }, "config": { "sort-packages": true, + "allow-plugins": { + "g1a/composer-test-scenarios": true, + "pyrech/composer-changelogs": true + }, "vendor-dir": "../../vendor" }, "extra": { diff --git a/.scenarios.lock/symfony6/.gitignore b/.scenarios.lock/symfony6/.gitignore new file mode 100644 index 0000000..5657f6e --- /dev/null +++ b/.scenarios.lock/symfony6/.gitignore @@ -0,0 +1 @@ +vendor \ No newline at end of file diff --git a/.scenarios.lock/symfony6/composer.json b/.scenarios.lock/symfony6/composer.json new file mode 100644 index 0000000..db3fd28 --- /dev/null +++ b/.scenarios.lock/symfony6/composer.json @@ -0,0 +1,58 @@ +{ + "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": "^6.0", + "php": ">=7.2", + "behat/behat": "^3.0.5", + "robertfausk/mink-panther-driver": "^1.0", + "friends-of-behat/mink-extension": "^2.3.0" + }, + "require-dev": { + "dbrekelmans/bdi": "^1.0", + "g1a/composer-test-scenarios": "^3.0", + "matthiasnoback/symfony-config-test": "^4.1", + "phpunit/phpunit": "~7.5|~9.3", + "roave/security-advisories": "dev-master" + }, + "autoload": { + "psr-4": { + "Robertfausk\\Behat\\PantherExtension\\": "../../src/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "../../tests/" + } + }, + "config": { + "sort-packages": true, + "allow-plugins": { + "g1a/composer-test-scenarios": true, + "pyrech/composer-changelogs": true + }, + "vendor-dir": "../../vendor" + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4c2ac67..0000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: php - -addons: - chrome: stable - -sudo: false - -matrix: - include: - - php: 8.0 - env: 'SCENARIO=symfony5' - - php: 7.4 - env: 'SCENARIO=symfony5' - - php: 7.4 - env: 'symfony3 DEPENDENCIES=lowest' - - php: 7.4 - env: 'symfony3 DEPENDENCIES=highest' - - php: 7.3 - env: 'SCENARIO=symfony3' - - php: 7.2 - env: 'SCENARIO=symfony3' - - php: 7.1 - env: 'SCENARIO=symfony3 DEPENDENCIES=highest' - -cache: - directories: - - $HOME/.composer/cache/files - -install: - - '.scenarios.lock/install "${SCENARIO}" "${DEPENDENCIES}"' - - bin/updatePantherChromeDriver.sh - - # additionally place 'chromedriver' file also in folder 'driver' for symfony/panther >=0.9 - - mkdir drivers - - cp vendor/symfony/panther/chromedriver-bin/chromedriver_linux64 drivers/chromedriver - -script: - - if [ "${TRAVIS_PHP_VERSION:0:3}" = "8.0" ]; then vendor/bin/phpunit -v; else vendor/bin/phpunit -v --coverage-clover=coverage.clover; fi - - vendor/bin/behat --config=tests/Behat/behat.yml - -after_script: - - wget https://scrutinizer-ci.com/ocular.phar - - if [ "${TRAVIS_PHP_VERSION:0:3}" != "8.0" ]; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi - - 'travis_retry php vendor/bin/coveralls -v' diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ec7ae7..538cec3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +v1.0.7 / 2022-02-16 +=================== + +Features: +* Add support for ```Symfony 6``` +* Add support for ```PHP 8.1``` +* Drop support for ```PHP 7.1``` cause of too much maintenance afford. Stick with ```v1.0.6``` if you want to use ```PHP 7.1```. + +Misc: +* Use GitHub Actions instead of Travis CI for continuous integration. + v1.0.6 / 2021-03-30 =================== diff --git a/Dockerfile b/Dockerfile index e3aee24..ae571b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ARG PHP_VERSION=7.2 -FROM composer:latest as composer +FROM composer:2 as composer FROM php:${PHP_VERSION}-cli # replace shell with bash so we can source files @@ -40,5 +40,7 @@ RUN if [[ "${PHP_VERSION}" = "7.4*" ]] || [[ "${PHP_VERSION}" = "8.0*" ]]; then docker-php-ext-install gd \ ;fi +RUN composer self-update + WORKDIR /var/www/html COPY . /var/www/html diff --git a/LICENSE b/LICENSE index 07d148f..b93d742 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019-2021 Robert Freigang +Copyright (c) 2019-2022 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 @@ -24,34 +24,34 @@ DEPENDENCY LICENSES: Name Version License behat/behat v3.7.0 MIT -behat/gherkin v4.8.0 MIT -behat/mink v1.8.1 MIT +behat/gherkin v4.9.0 MIT +behat/mink v1.9.0 MIT behat/transliterator v1.3.0 Artistic-1.0 friends-of-behat/mink-extension v2.5.0 MIT -php-webdriver/webdriver 1.9.0 MIT -psr/container 1.0.0 MIT -psr/log 1.1.3 MIT -robertfausk/mink-panther-driver v1.0.7 MIT -symfony/browser-kit v5.2.3 MIT +php-webdriver/webdriver 1.12.0 MIT +psr/container 1.1.2 MIT +psr/log 2.0.0 MIT +robertfausk/mink-panther-driver v1.0.8 MIT +symfony/browser-kit v5.4.3 MIT symfony/config v3.4.47 MIT -symfony/console v4.4.19 MIT -symfony/css-selector v5.2.3 MIT +symfony/console v4.4.37 MIT +symfony/css-selector v5.4.3 MIT symfony/dependency-injection v3.4.47 MIT -symfony/deprecation-contracts v2.2.0 MIT -symfony/dom-crawler v5.2.3 MIT -symfony/event-dispatcher v4.4.19 MIT -symfony/event-dispatcher-contracts v1.1.9 MIT -symfony/filesystem v4.4.19 MIT -symfony/http-client v5.2.3 MIT -symfony/http-client-contracts v2.3.1 MIT -symfony/panther v1.0.1 MIT -symfony/polyfill-ctype v1.22.1 MIT -symfony/polyfill-mbstring v1.22.1 MIT -symfony/polyfill-php72 v1.22.1 MIT -symfony/polyfill-php73 v1.22.1 MIT -symfony/polyfill-php80 v1.22.1 MIT -symfony/process v5.2.3 MIT -symfony/service-contracts v2.2.0 MIT -symfony/translation v4.4.19 MIT -symfony/translation-contracts v2.3.0 MIT -symfony/yaml v5.2.3 MIT \ No newline at end of file +symfony/deprecation-contracts v2.5.0 MIT +symfony/dom-crawler v5.4.3 MIT +symfony/event-dispatcher v4.4.37 MIT +symfony/event-dispatcher-contracts v1.1.11 MIT +symfony/filesystem v4.4.37 MIT +symfony/http-client v5.4.3 MIT +symfony/http-client-contracts v2.5.0 MIT +symfony/panther v1.1.1 MIT +symfony/polyfill-ctype v1.24.0 MIT +symfony/polyfill-mbstring v1.24.0 MIT +symfony/polyfill-php72 v1.24.0 MIT +symfony/polyfill-php73 v1.24.0 MIT +symfony/polyfill-php80 v1.24.0 MIT +symfony/process v5.4.3 MIT +symfony/service-contracts v2.5.0 MIT +symfony/translation v4.4.37 MIT +symfony/translation-contracts v2.5.0 MIT +symfony/yaml v5.3.14 MIT \ No newline at end of file diff --git a/README.md b/README.md index 34c941e..6581e4b 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,17 @@ [![Latest Unstable Version](https://poser.pugx.org/robertfausk/behat-panther-extension/v/unstable.svg)](https://packagist.org/packages/robertfausk/behat-panther-extension) [![Total Downloads](https://poser.pugx.org/robertfausk/behat-panther-extension/downloads.svg)](https://packagist.org/packages/robertfausk/behat-panther-extension) [![Monhtly Downloads](https://img.shields.io/packagist/dm/robertfausk/behat-panther-extension?style=flat&color=blue)](https://img.shields.io/packagist/dm/robertfausk/behat-panther-extension) -[![Build Status](https://travis-ci.com/robertfausk/behat-panther-extension.svg?branch=master)](https://travis-ci.com/robertfausk/behat-panther-extension) +[![Daily Downloads](https://img.shields.io/packagist/dd/robertfausk/behat-panther-extension?style=flat&color=blue)](https://img.shields.io/packagist/dm/robertfausk/behat-panther-extension) +[![Tests](https://github.com/robertfausk/behat-panther-extension/actions/workflows/ci.yml/badge.svg)](https://github.com/robertfausk/behat-panther-extension/actions/workflows/ci.yml) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/robertfausk/behat-panther-extension/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/robertfausk/behat-panther-extension/) [![Code Coverage](https://scrutinizer-ci.com/g/robertfausk/behat-panther-extension/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/robertfausk/behat-panther-extension/) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE) -![PHP7 Compatible](https://img.shields.io/travis/php-v/robertfausk/behat-panther-extension/master?style=flat) +[![PHP Version Require](http://poser.pugx.org/robertfausk/behat-panther-extension/require/php)](https://packagist.org/packages/robertfausk/behat-panther-extension) [![Open Issues](https://img.shields.io/github/issues-raw/robertfausk/behat-panther-extension?style=flat)](https://github.com/robertfausk/behat-panther-extension/issues) [![Closed Issues](https://img.shields.io/github/issues-closed-raw/robertfausk/behat-panther-extension?style=flat)](https://github.com/robertfausk/behat-panther-extension/issues?q=is%3Aissue+is%3Aclosed) [![Contributors](https://img.shields.io/github/contributors/robertfausk/behat-panther-extension?style=flat)](https://github.com/robertfausk/behat-panther-extension/graphs/contributors) ![Contributors](https://img.shields.io/maintenance/yes/2022?style=flat) +[![Dependents](http://poser.pugx.org/robertfausk/behat-panther-extension/dependents)](https://packagist.org/packages/robertfausk/behat-panther-extension/dependents) Symfony Panther extension for Behat @@ -176,13 +178,13 @@ private function spin(\Closure $closure, ?int $tries = 25): ?NodeElement ## How to contribute? -Start docker-compose with php version of your choice. At the moment the following php versions can be used with docker-compose: php7.1, php7.2, php7.3, php7.4 and php8.0. +Start docker-compose with php version of your choice. At the moment the following php versions can be used with docker-compose: php7.2, php7.3, php7.4, php8.0 and php8.1. - docker-compose up php7.2 + docker-compose up php8.1 Run phpunit tests - docker-compose run php7.2 vendor/bin/phpunit + docker-compose run php8.1 vendor/bin/phpunit ## Credits diff --git a/composer.json b/composer.json index c38d0e7..bea6a80 100644 --- a/composer.json +++ b/composer.json @@ -19,17 +19,18 @@ } ], "require": { - "php": ">=7.1", + "php": ">=7.2", "behat/behat": "^3.0.5", "robertfausk/mink-panther-driver": "^1.0", - "symfony/config": "^3.4|^4.0|^5.0", + "symfony/config": "^3.4|^4.0|^5.0|^6.0", "friends-of-behat/mink-extension": "^2.3.0" }, "require-dev": { - "roave/security-advisories": "dev-master", - "phpunit/phpunit": "~7.5|~9.3", + "dbrekelmans/bdi": "^1.0", + "g1a/composer-test-scenarios": "^3.0", "matthiasnoback/symfony-config-test": "^4.1", - "g1a/composer-test-scenarios": "^3.0" + "phpunit/phpunit": "~7.5|~9.3", + "roave/security-advisories": "dev-master" }, "autoload": { "psr-4": { @@ -42,13 +43,22 @@ } }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "g1a/composer-test-scenarios": true, + "pyrech/composer-changelogs": true + } }, "extra": { "branch-alias": { "dev-master": "1.0.x-dev" }, "scenarios": { + "symfony6": { + "require": { + "symfony/config": "^6.0" + } + }, "symfony5": { "require": { "symfony/config": "^5.0" diff --git a/docker-compose.yml b/docker-compose.yml index 03b7263..afefab5 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,15 +1,6 @@ version: "3" services: - php7.1: - tty: true - build: - context: . - args: - - PHP_VERSION=7.1 - volumes: - - .:/var/www/html - php7.2: tty: true build: @@ -45,3 +36,12 @@ services: - PHP_VERSION=8.0 volumes: - .:/var/www/html + + php8.1: + tty: true + build: + context: . + args: + - PHP_VERSION=8.1 + volumes: + - .:/var/www/html