From 4a3e71b10a392fe828406b579a081c6ef0bbfb5e Mon Sep 17 00:00:00 2001 From: Dan Hensby Date: Thu, 26 Mar 2020 10:41:59 +0000 Subject: [PATCH 1/5] Bump min-php and phpunit versions --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 4fd259f..3f84e02 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,8 @@ } ], "require": { - "php": ">=7.1", - "phpunit/phpunit": "^7@dev", + "php": "^7.2", + "phpunit/phpunit": "^7 || ^8", "behat/behat": "^3.2", "behat/mink": "^1.7", "behat/mink-extension": "^2.1", From 26bd98b3b2bf7478efa9d84a054ee7f5d552bdbf Mon Sep 17 00:00:00 2001 From: Dan Hensby Date: Thu, 26 Mar 2020 10:51:27 +0000 Subject: [PATCH 2/5] Update travis supported php versions --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f9f0fa3..c8e716b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,9 @@ cache: - $HOME/.composer/cache/files php: - - 7.1 - 7.2 + - 7.3 + - 7.4 env: matrix: From cd320df6eaec4784d1c04ed4c9726a1bf166bc7f Mon Sep 17 00:00:00 2001 From: Dan Hensby Date: Thu, 26 Mar 2020 10:53:58 +0000 Subject: [PATCH 3/5] Require v5.x-dev of recipe-core for test suites --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c8e716b..4e44bfa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ before_script: - export PATH=~/.composer/vendor/bin:$PATH - composer validate - composer install --dev --prefer-dist - - composer require --prefer-dist --no-update silverstripe/recipe-core:2.x-dev + - composer require --prefer-dist --no-update silverstripe/recipe-core:5.x-dev - 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 From 2a19212e17fc4ed834b1e315e6f9e78093fa9f27 Mon Sep 17 00:00:00 2001 From: Dan Hensby Date: Thu, 26 Mar 2020 10:56:33 +0000 Subject: [PATCH 4/5] Bring travis isntallation steps inline with framework --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4e44bfa..89afae0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,9 +21,8 @@ env: before_script: - export PATH=~/.composer/vendor/bin:$PATH - composer validate - - composer install --dev --prefer-dist - composer require --prefer-dist --no-update silverstripe/recipe-core:5.x-dev - - composer update + - composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile - if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o; fi - phpenv rehash From dae94f0f9aee4893999f1c0d09f32cd176b339b8 Mon Sep 17 00:00:00 2001 From: Dan Hensby Date: Thu, 26 Mar 2020 10:59:23 +0000 Subject: [PATCH 5/5] Improve compatability with phpunit 8 --- tests/php/SilverStripeContextTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/php/SilverStripeContextTest.php b/tests/php/SilverStripeContextTest.php index 3c62e41..873cfe0 100644 --- a/tests/php/SilverStripeContextTest.php +++ b/tests/php/SilverStripeContextTest.php @@ -8,6 +8,7 @@ use Behat\Mink\Session; use Behat\Mink\Mink; use Behat\Mink\Driver\DriverInterface; use Behat\Mink\Element\Element; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use SilverStripe\BehatExtension\Tests\SilverStripeContextTest\FeatureContext; use SilverStripe\Dev\SapphireTest; @@ -17,7 +18,7 @@ class SilverStripeContextTest extends TestCase protected $backupGlobals = false; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { // Bootstrap test environment parent::setUpBeforeClass(); @@ -100,7 +101,7 @@ class SilverStripeContextTest extends TestCase } /** - * @return Element|\PHPUnit_Framework_MockObject_MockObject + * @return Element|MockObject */ protected function getElementMock() {