From ffa4706e3bdbbc17ded07a7c22367249820e6d88 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 27 Oct 2021 18:08:55 +1300 Subject: [PATCH] API phpunit 9 support --- composer.json | 5 +++-- phpunit.xml.dist | 8 +++++--- tests/AbstractTest.php | 4 ++-- tests/DatabaseStoreTest.php | 2 +- tests/HybridSessionTest.php | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 71344c2..15f9bcb 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,11 @@ } ], "require": { - "silverstripe/framework": "^4" + "php": "^7.3 || ^8.0", + "silverstripe/framework": "^4.10" }, "require-dev": { - "sminnee/phpunit": "^5.7", + "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "^3.0", "silverstripe/versioned": "^1" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5c53cbd..0281bef 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,8 +1,10 @@ - - tests - + + + tests + + diff --git a/tests/AbstractTest.php b/tests/AbstractTest.php index 011fe0e..e6c98af 100644 --- a/tests/AbstractTest.php +++ b/tests/AbstractTest.php @@ -12,7 +12,7 @@ abstract class AbstractTest extends SapphireTest { protected $usesDatabase = true; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -26,7 +26,7 @@ protected function setUp() DBDatetime::set_mock_now('2010-03-15 12:00:00'); } - protected function tearDown() + protected function tearDown(): void { DBDatetime::clear_mock_now(); diff --git a/tests/DatabaseStoreTest.php b/tests/DatabaseStoreTest.php index 62b17c3..00d3e5c 100644 --- a/tests/DatabaseStoreTest.php +++ b/tests/DatabaseStoreTest.php @@ -9,7 +9,7 @@ class DatabaseStoreTest extends AbstractTest { - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/HybridSessionTest.php b/tests/HybridSessionTest.php index 75aa0e3..89c329a 100644 --- a/tests/HybridSessionTest.php +++ b/tests/HybridSessionTest.php @@ -19,7 +19,7 @@ class HybridSessionTest extends SapphireTest */ protected $instance; - protected function setUp() + protected function setUp(): void { parent::setUp();