From b75c52b9236b7261042245286e4f6f499e351500 Mon Sep 17 00:00:00 2001 From: robertfausk Date: Tue, 21 Dec 2021 12:07:34 +0100 Subject: [PATCH 1/5] Fix usage of refreshCrawler(), isChecked() and enable RadioTest --- src/PantherDriver.php | 14 +++++++++----- tests/Custom/RadioTest.php | 19 ------------------- 2 files changed, 9 insertions(+), 24 deletions(-) delete mode 100644 tests/Custom/RadioTest.php diff --git a/src/PantherDriver.php b/src/PantherDriver.php index 69e989b..b63c2f4 100644 --- a/src/PantherDriver.php +++ b/src/PantherDriver.php @@ -137,7 +137,13 @@ public function isStarted() */ public function stop() { - $this->getClient()->quit(); + try { + $this->getClient()->quit(); + } catch (DriverException $e) { + // do nothing + } + //$this->getClient()->quit(); + self::stopWebServer(); $this->started = false; } @@ -229,7 +235,6 @@ public function back() public function switchToWindow($name = null) { $this->getClient()->switchTo()->window($name); - $this->getClient()->refreshCrawler(); } /** @@ -423,6 +428,7 @@ public function isSelected($xpath) */ public function findElementXpaths($xpath) { + $this->getClient()->refreshCrawler(); $nodes = $this->getCrawler()->filterXPath($xpath); $elements = []; @@ -586,7 +592,6 @@ public function selectOption($xpath, $value, $multiple = false) public function click($xpath) { $this->getClient()->getMouse()->click($this->toCoordinates($xpath)); - $this->getClient()->refreshCrawler(); } /** @@ -610,7 +615,7 @@ public function rightClick($xpath) */ public function isChecked($xpath) { - return $this->getChoiceFormField($xpath)->hasValue(); + return $this->getCrawlerElement($this->getFilteredCrawler($xpath))->isSelected(); } /** @@ -709,7 +714,6 @@ public function submitForm($xpath) $crawler = $this->getFilteredCrawler($xpath); $this->getClient()->submit($crawler->form()); - $this->getClient()->refreshCrawler(); } /** diff --git a/tests/Custom/RadioTest.php b/tests/Custom/RadioTest.php deleted file mode 100644 index f86270e..0000000 --- a/tests/Custom/RadioTest.php +++ /dev/null @@ -1,19 +0,0 @@ -markTestSkipped('Still buggy.'); - } - - public function testSetValue() - { - $this->markTestSkipped('Still buggy.'); - } -} From 914cf0b397dbd54f00e6f15668ff72ca29a005a8 Mon Sep 17 00:00:00 2001 From: robertfausk Date: Tue, 21 Dec 2021 12:11:01 +0100 Subject: [PATCH 2/5] Add github actions workflow file --- .github/workflows/ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9f607bc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI + +on: + push: + pull_request: + +defaults: + run: + shell: bash + +jobs: + + tests: + name: Tests + runs-on: ubuntu-20.04 + strategy: + matrix: + php: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] + fail-fast: false + env: + MATRIX_PHP: ${{ matrix.php }} + + 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 + # PHP 7.1 development web server segfaults if timezone not set. + ini-values: date.timezone=Europe/Berlin, error_reporting=-1, display_errors=On + - name: Configure for PHP >= 7.2 + if: "${{ matrix.php >= '7.2' }}" + run: | + composer require --no-update --dev dbrekelmans/bdi + - name: Install dependencies + run: | + composer update --no-interaction --prefer-dist + - name: Add browser drivers for PHP >= 7.2 + if: "${{ matrix.php >= '7.2' }}" + run: | + vendor/bin/bdi detect drivers + - name: Add browser drivers for PHP == 7.1 + if: "${{ matrix.php == '7.1' }}" + # additionally, place 'chromedriver' file also in folder 'driver' for symfony/panther >=0.9 and PHP 7.1 + run: | + bin/updatePantherChromeDriver.sh + mkdir drivers + mv vendor/symfony/panther/chromedriver-bin/chromedriver_linux64 drivers/chromedriver + - name: Setup Mink test server + # PHP 7.1 development web server segfaults if USE_ZEND_ALLOC not set to 0. + run: | + mkdir ./logs + export USE_ZEND_ALLOC=0 + ./vendor/bin/mink-test-server &> ./logs/mink-test-server.log & + - name: Run tests + run: | + vendor/bin/phpunit -v + - name: Archive logs artifacts + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + name: logs_php-${{ matrix.php }} + path: | + logs From d05b64b72020287d50fda2840aee802bef1fc279 Mon Sep 17 00:00:00 2001 From: robertfausk Date: Tue, 21 Dec 2021 15:06:21 +0100 Subject: [PATCH 3/5] Do not use w3c compliant mode in tests cause getOuterHtml will return an empty string in chrome 96 otherwise --- tests/PantherConfig.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/PantherConfig.php b/tests/PantherConfig.php index 95461dd..668e37b 100644 --- a/tests/PantherConfig.php +++ b/tests/PantherConfig.php @@ -20,7 +20,17 @@ public function createDriver() { $_SERVER['PANTHER_WEB_SERVER_DIR'] = __DIR__.'/../vendor/mink/driver-testsuite/web-fixtures/'; - return new PantherDriver(); + return new PantherDriver( + [], + [], + [ + 'capabilities' => [ + 'goog:chromeOptions' => [ + 'w3c' => false, + ], + ], + ] + ); } /** From 4e33f2f1dd4b2f56b33fca4ed32839dcb45127f9 Mon Sep 17 00:00:00 2001 From: robertfausk Date: Wed, 22 Dec 2021 08:56:56 +0100 Subject: [PATCH 4/5] Revert w3c disabling, revert changes in stop(), cleanup usage of refreshCrawler() --- src/PantherDriver.php | 9 ++------- tests/PantherConfig.php | 12 +----------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/PantherDriver.php b/src/PantherDriver.php index b63c2f4..c1e0463 100644 --- a/src/PantherDriver.php +++ b/src/PantherDriver.php @@ -137,13 +137,7 @@ public function isStarted() */ public function stop() { - try { - $this->getClient()->quit(); - } catch (DriverException $e) { - // do nothing - } - //$this->getClient()->quit(); - + $this->getClient()->quit(); self::stopWebServer(); $this->started = false; } @@ -452,6 +446,7 @@ public function getTagName($xpath) */ public function getText($xpath) { + $this->getClient()->refreshCrawler(); $text = $this->getFilteredCrawler($xpath)->text(); $text = str_replace("\n", ' ', $text); $text = preg_replace('/ {2,}/', ' ', $text); diff --git a/tests/PantherConfig.php b/tests/PantherConfig.php index 668e37b..95461dd 100644 --- a/tests/PantherConfig.php +++ b/tests/PantherConfig.php @@ -20,17 +20,7 @@ public function createDriver() { $_SERVER['PANTHER_WEB_SERVER_DIR'] = __DIR__.'/../vendor/mink/driver-testsuite/web-fixtures/'; - return new PantherDriver( - [], - [], - [ - 'capabilities' => [ - 'goog:chromeOptions' => [ - 'w3c' => false, - ], - ], - ] - ); + return new PantherDriver(); } /** From c8947e33edf41af468c8edbbd671afa4b22885e5 Mon Sep 17 00:00:00 2001 From: Robert Freigang Date: Tue, 15 Feb 2022 13:20:27 +0100 Subject: [PATCH 5/5] Remove travis, add GitHub Actions; drop support for PHP 7.1; add support for PHP 8.1 Still working? Still working? Still working? Still working? Digging around to get older chromedriver getting used by sudo give me a cookie Digging around to get older chromedriver getting used by Digging around to get older chromedriver getting used by Digging around to get older chromedriver getting used by Digging around to get older chromedriver getting used by Digging around to get older chromedriver getting used by Digging around to get older chromedriver getting used by Digging around to get older chromedriver getting used by Explicitly specify full path to WEBDRIVER_CHROME_DRIVER Explicitly specify full path to WEBDRIVER_CHROME_DRIVER Explicitly specify full path to WEBDRIVER_CHROME_DRIVER Explicitly specify full path to WEBDRIVER_CHROME_DRIVER Increase revision number; further debug binary usage Increase revision number; further debug binary usage Increase revision number; further debug binary usage Increase revision number; further debug binary usage Increase revision number; further debug binary usage Increase revision number; further debug binary usage Debug ENV set usage Run panther without bdi give it a try cause it should work without it according to symfony/panther Use revision 857949 instead of 857950 Force usage of specific revision for chrome install and set PANTHER_CHROME_BINARY via env var Force usage of specific revision for chrome install and set PANTHER_CHROME_BINARY via env var Force usage of newest CHROMIUM_BIN via env var Use latest chrome browser for tests to get away from 98 and try to get 99 cause of: - tests are fine with 90.* - tests fail with 98.0.4758.102 Allow ~5.0|~6.0 for symfony/dom-crawler and symfony/http-kernel Bump phpunit version and enable code coverage Drop support for PHP 7.1 Trigger new build --- .github/workflows/ci.yml | 43 ++++++++++++++++---------------- .travis.yml | 42 ------------------------------- CHANGELOG.md | 12 +++++++++ Dockerfile | 2 +- README.md | 20 ++++++--------- bin/updatePantherChromeDriver.sh | 43 -------------------------------- composer.json | 23 +++++++++++------ docker-compose.yml | 9 ------- 8 files changed, 58 insertions(+), 136 deletions(-) delete mode 100644 .travis.yml delete mode 100755 bin/updatePantherChromeDriver.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f607bc..dc34d97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,11 +15,11 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - php: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] + php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ] fail-fast: false env: MATRIX_PHP: ${{ matrix.php }} - + PANTHER_CHROME_BINARY: '/opt/hostedtoolcache/chromium/858016/x64/chrome' steps: - name: Checkout uses: actions/checkout@v2 @@ -28,38 +28,37 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - coverage: "none" + coverage: "xdebug" php-version: "${{ matrix.php }}" + extensions: zip tools: composer - # PHP 7.1 development web server segfaults if timezone not set. - ini-values: date.timezone=Europe/Berlin, error_reporting=-1, display_errors=On - - name: Configure for PHP >= 7.2 - if: "${{ matrix.php >= '7.2' }}" - run: | - composer require --no-update --dev dbrekelmans/bdi + ini-values: error_reporting=-1, display_errors=On - name: Install dependencies run: | - composer update --no-interaction --prefer-dist - - name: Add browser drivers for PHP >= 7.2 - if: "${{ matrix.php >= '7.2' }}" + composer install --no-interaction --no-scripts --no-progress --prefer-dist + - uses: browser-actions/setup-chrome@latest + with: + chrome-version: 858016 + - run: chrome --version + - name: Uninstall chromedriver from Ubuntu run: | - vendor/bin/bdi detect drivers - - name: Add browser drivers for PHP == 7.1 - if: "${{ matrix.php == '7.1' }}" - # additionally, place 'chromedriver' file also in folder 'driver' for symfony/panther >=0.9 and PHP 7.1 + sudo apt-get remove chromium-chromedriver + - name: Add browser drivers run: | - bin/updatePantherChromeDriver.sh - mkdir drivers - mv vendor/symfony/panther/chromedriver-bin/chromedriver_linux64 drivers/chromedriver + vendor/bin/bdi driver:chromedriver --driver-version=90.0.4430.24 drivers - name: Setup Mink test server - # PHP 7.1 development web server segfaults if USE_ZEND_ALLOC not set to 0. run: | mkdir ./logs - export USE_ZEND_ALLOC=0 ./vendor/bin/mink-test-server &> ./logs/mink-test-server.log & + - name: Remove preinstalled chromedriver bin from ubuntu + run: sudo rm -rf /usr/local/share/chrome_driver - name: Run tests run: | - vendor/bin/phpunit -v + vendor/bin/phpunit -v --coverage-clover=coverage.xml + - name: Upload coverage + uses: codecov/codecov-action@v2 + with: + files: coverage.xml - name: Archive logs artifacts if: ${{ failure() }} uses: actions/upload-artifact@v2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3368e83..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: php - -os: linux -arch: - - amd64 -dist: bionic - -php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1] - -matrix: - fast_finish: true - include: - # Test against dev versions of dependencies - - php: 7.4 - env: DEPENDENCIES='dev' - -cache: - directories: - - $HOME/.composer/cache/files - -before_install: - - if [ "$DEPENDENCIES" = "dev" ]; then composer config minimum-stability dev; fi; - -install: - - composer install - - if [ "${TRAVIS_PHP_VERSION:0:3}" != "7.1" ]; then composer require --dev dbrekelmans/bdi; fi - - if [ "${TRAVIS_PHP_VERSION:0:3}" != "7.1" ]; then vendor/bin/bdi detect drivers; fi - - if [ "${TRAVIS_PHP_VERSION:0:3}" = "7.1" ]; then bin/updatePantherChromeDriver.sh; fi - - # additionally place 'chromedriver' file also in folder 'driver' for symfony/panther >=0.9 and PHP 7.1 - - if [ "${TRAVIS_PHP_VERSION:0:3}" = "7.1" ]; then mkdir drivers; fi - - if [ "${TRAVIS_PHP_VERSION:0:3}" = "7.1" ]; then mv vendor/symfony/panther/chromedriver-bin/chromedriver_linux64 drivers/chromedriver; fi - # Start a webserver for web fixtures. - - vendor/bin/mink-test-server > /dev/null 2>&1 & - -script: if [ "${TRAVIS_PHP_VERSION:0:3}" = "8.0" ]; then vendor/bin/phpunit -v; else vendor/bin/phpunit -v --coverage-clover=coverage.clover; fi - -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 - -after_failure: - - cat /tmp/webdriver_output.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 00dea19..b64f411 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +v1.1.0 / 2022-02-xx +================== + +Features: +* Add support for ```symfony/panther:~2.0```. +* Add support for ```PHP 8.1```. +* Drop support for ```PHP 7.1``` cause of too much maintenance afford. Stick with ```v1.0.8``` if you want to use ```PHP 7.1```. +* Enable RadioTest::testIsChecked and RadioTest::testSetValue as soon as ```symfony/panther#v2.0.2``` ist out. + +Misc: +* Use GitHub Actions instead of Travis CI for continuous integration. + v1.0.8 / 2021-03-14 ================== diff --git a/Dockerfile b/Dockerfile index 5a5e086..b1f25dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ARG PHP_VERSION=7.2 -FROM composer:latest as composer +FROM composer:2.2 as composer FROM php:${PHP_VERSION} # replace shell with bash so we can source files diff --git a/README.md b/README.md index 50aa516..c00d0d0 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,18 @@ [![Latest Unstable Version](https://poser.pugx.org/robertfausk/mink-panther-driver/v/unstable.svg)](https://packagist.org/packages/robertfausk/mink-panther-driver) [![Total Downloads](https://poser.pugx.org/robertfausk/mink-panther-driver/downloads.svg)](https://packagist.org/packages/robertfausk/mink-panther-driver) [![Monhtly Downloads](https://img.shields.io/packagist/dm/robertfausk/mink-panther-driver?style=flat&color=blue)](https://img.shields.io/packagist/dm/robertfausk/mink-panther-driver) -[![Build Status](https://travis-ci.com/robertfausk/mink-panther-driver.svg?branch=master)](https://travis-ci.com/robertfausk/mink-panther-driver) +[![Daily Downloads](https://img.shields.io/packagist/dd/robertfausk/mink-panther-driver?style=flat&color=blue)](https://img.shields.io/packagist/dm/robertfausk/mink-panther-driver) +[![Tests](https://github.com/robertfausk/mink-panther-driver/actions/workflows/ci.yml/badge.svg)](https://github.com/robertfausk/mink-panther-driver/actions/workflows/ci.yml) [![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/robertfausk/mink-panther-driver/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/robertfausk/mink-panther-driver/) [![Code Coverage](https://scrutinizer-ci.com/g/robertfausk/mink-panther-driver/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/robertfausk/mink-panther-driver/) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE) -![PHP7 Compatible](https://img.shields.io/travis/php-v/robertfausk/mink-panther-driver/master?style=flat) +[![PHP Version Require](http://poser.pugx.org/robertfausk/mink-panther-driver/require/php)](https://packagist.org/packages/robertfausk/mink-panther-driver) [![Open Issues](https://img.shields.io/github/issues-raw/robertfausk/mink-panther-driver?style=flat)](https://github.com/robertfausk/mink-panther-driver/issues) [![Closed Issues](https://img.shields.io/github/issues-closed-raw/robertfausk/mink-panther-driver?style=flat)](https://github.com/robertfausk/mink-panther-driver/issues?q=is%3Aissue+is%3Aclosed) [![Contributors](https://img.shields.io/github/contributors/robertfausk/mink-panther-driver?style=flat)](https://github.com/robertfausk/mink-panther-driver/graphs/contributors) ![Contributors](https://img.shields.io/maintenance/yes/2022?style=flat) +[![Dependents](http://poser.pugx.org/robertfausk/mink-panther-driver/dependents)](https://packagist.org/packages/robertfausk/mink-panther-driver/dependents) + Symfony Panther driver for Mink framework @@ -69,24 +72,17 @@ and give [robertfausk/behat-panther-extension](https://github.com/robertfausk/be Start docker-compose with php web driver - docker-compose up php8.0 + docker-compose up php8.1 Run phpunit tests - docker-compose exec php8.0 vendor/bin/phpunit + docker-compose exec php8.1 vendor/bin/phpunit If you run into issues of type ```session not created: This version of ChromeDriver only supports Chrome version 79``` then it is because of mismatched versions between installed chrome driver and chromium. Best way to bypass this problem is to update them to their newest version. - docker-compose exec php8.0 composer require --dev dbrekelmans/bdi --ignore-platform-req=php - docker-compose exec php8.0 vendor/bin/bdi detect drivers - -If you are developing for PHP 7.1 then you should use following. -The first line could be sufficient but this depends on your actual setup. - - docker-compose exec php7.1 bin/updatePantherChromeDriver.sh - docker-compose build php7.1 + docker-compose exec php8.1 vendor/bin/bdi detect drivers ## Credits diff --git a/bin/updatePantherChromeDriver.sh b/bin/updatePantherChromeDriver.sh deleted file mode 100755 index 6897036..0000000 --- a/bin/updatePantherChromeDriver.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash -# ensure that symfony/panther's chromeDriver matches installed chromium version -# this needs chromium and symfony/panther (in vendor folder) to be installed - -mkdir -p vendor/symfony/panther/chromedriver-bin -cd vendor/symfony/panther/chromedriver-bin - -chromiumVersion=$(chromium --product-version 2>&1;); -chromiumBrowserVersion=$(chromium-browser --product-version 2>&1;); -googleChromeVersion=$(google-chrome --product-version 2>&1;); -if [[ ${chromiumVersion} == *"."*"."* ]]; then - chromiumVersion="$( cut -d '.' -f 1 <<< "$chromiumVersion" )"; - echo "Found chromium version ${chromiumVersion}"; - chromeDriverVersion="_${chromiumVersion}" -elif [[ ${chromiumBrowserVersion} == *"."*"."* ]]; then - chromiumBrowserVersion="$( cut -d '.' -f 1 <<< "$chromiumBrowserVersion" )"; - echo "Found chromium-browser version ${chromiumBrowserVersion}"; - chromeDriverVersion="_${chromiumBrowserVersion}" -elif [[ ${googleChromeVersion} == *"."*"."* ]]; then - googleChromeVersion="$( cut -d '.' -f 1 <<< "$googleChromeVersion" )"; - echo "Found google-chrome version ${googleChromeVersion}"; - chromeDriverVersion="_${googleChromeVersion}" -else - "No google-chrome, chromium-browser or chromium found. Using latest release..." - chromeDriverVersion="" -fi - -chromeDriver=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE${chromeDriverVersion}); -echo "Downloading ChromeDriver version ${chromeDriver} from https://chromedriver.storage.googleapis.com/LATEST_RELEASE${chromeDriverVersion} ..." - -declare -a binaries=("chromedriver_linux64" "chromedriver_mac64" "chromedriver_win32") -for name in "${binaries[@]}" -do - curl -s https://chromedriver.storage.googleapis.com/${chromeDriver}/${name}.zip -O - unzip -q -o ${name}.zip - rm ${name}.zip - if [[ -f "chromedriver" ]]; then - mv chromedriver ${name} - fi -done - -curl -s https://chromedriver.storage.googleapis.com/${chromeDriver}/notes.txt -O -echo "Done." diff --git a/composer.json b/composer.json index 883f05e..32f3b6e 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,11 @@ "Symfony", "Mink", "testing", + "panther", + "chrome", + "chromium", + "firefox", + "headless", "browser" ], "homepage": "http://mink.behat.org/", @@ -17,22 +22,26 @@ } ], "require": { - "php": ">=7.1", + "php": ">=7.2", "behat/mink": "~1.8", - "symfony/panther": "~0.7|~1.0", + "symfony/panther": "~0.7|~1.0|~2.0", "ext-dom": "*" }, "require-dev": { + "dbrekelmans/bdi": "^1.0", "mink/driver-testsuite": "dev-master", - "phpunit/phpunit": "~6.0|~7.0|~8.0|~9.0", - "symfony/dom-crawler": "~2.3|~3.0|~4.0", - "symfony/http-kernel": "~2.3|~3.0|~4.0" + "phpunit/phpunit": "~8.5|~9.3", + "symfony/dom-crawler": "~4.0|~5.0|~6.0", + "symfony/http-kernel": "~4.0|~5.0|~6.0" }, "scripts": { "qa": "" }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "pyrech/composer-changelogs": true + } }, "suggest": { "ext-gd": "*" @@ -49,7 +58,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } } } diff --git a/docker-compose.yml b/docker-compose.yml index 3936558..c1e3bad 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,12 +45,3 @@ services: - PHP_VERSION=7.2 volumes: - .:/var/www/html - - php7.1: - tty: true - build: - context: . - args: - - PHP_VERSION=7.1 - volumes: - - .:/var/www/html