From efdd90b19724971d62dea9709da0c3a28e05e51b Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Tue, 16 Mar 2021 15:31:47 +1300 Subject: [PATCH] MNT Add support for symphony 4 and switch to shared travis config (#199) * MNT Add support for symphony 4 and switch to shared travis config * Specify DB * Update phpunit config * Don't test php 8 * Pleasing PHP8 * Use correct syntax for composer OR constraints * Doing the constraint right ... maybe Co-authored-by: Steve Boyd Co-authored-by: Steve Boyd --- .travis.yml | 40 ++++++----------------------- composer.json | 4 +-- phpunit.xml.dist | 9 ++++--- src/Context/SilverStripeContext.php | 2 +- 4 files changed, 16 insertions(+), 39 deletions(-) diff --git a/.travis.yml b/.travis.yml index e888e79..0e349ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,10 @@ -language: php +version: ~> 1.0 -dist: xenial +import: + - silverstripe/silverstripe-travis-shared:config/provision/standard-jobs-fixed.yml -sudo: false - -cache: - directories: - - $HOME/.composer/cache/files -matrix: - include: - - php: 7.1 - env: PHPUNIT_TEST=1 - - php: 7.2 - env: PHPUNIT_TEST=1 - - php: 7.3 - env: PHPUNIT_TEST=1 PHPCS_TEST=1 - - php: 7.4 - env: PHPUNIT_TEST=1 - - - -before_script: - - export PATH=~/.composer/vendor/bin:$PATH - - composer validate - - composer install --prefer-dist - - composer require --prefer-dist --no-update silverstripe/recipe-core:^4 - - composer update - - if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o; fi - - phpenv rehash - -script: - - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/php; fi - - if [[ $PHPCS_TEST ]]; then composer run-script lint; fi +env: + global: + - COMPOSER_ROOT_VERSION="1.x-dev" + - REQUIRE_RECIPE="4.x-dev" + - PHPUNIT_TEST=1 diff --git a/composer.json b/composer.json index fe4b924..97cb352 100644 --- a/composer.json +++ b/composer.json @@ -27,10 +27,10 @@ "behat/mink": "^1.7", "behat/mink-extension": "^2.1", "silverstripe/mink-facebook-web-driver": "^1", - "symfony/dom-crawler": "^3", + "symfony/dom-crawler": "^3 || ^4", "silverstripe/testsession": "^2.2", "silverstripe/framework": "^4", - "symfony/finder": "^3.2" + "symfony/finder": "^3.2 || ^4" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2e0ac12..b00a4ea 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,6 @@ - - - tests/php - + + + + tests/php + diff --git a/src/Context/SilverStripeContext.php b/src/Context/SilverStripeContext.php index 68e1b13..b8c0ab6 100644 --- a/src/Context/SilverStripeContext.php +++ b/src/Context/SilverStripeContext.php @@ -87,7 +87,7 @@ abstract class SilverStripeContext extends MinkContext implements SilverStripeAw */ public function __construct(array $parameters = null) { - if (!preg_match('/\\FeatureContext$/', get_class($this))) { + if (!preg_match('/\\\FeatureContext$/', get_class($this))) { throw new InvalidArgumentException( 'Subclasses of SilverStripeContext must be named FeatureContext. Found "' . get_class($this) . '""' );