From 641969b8ec1bbb230ec2f1b2642f02651e6ace91 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 4 Nov 2021 12:04:14 +1300 Subject: [PATCH] API phpunit 9 support --- composer.json | 6 +++--- tests/WorkflowEmbargoExpiryTest.php | 4 ++-- tests/WorkflowEngineTest.php | 2 +- tests/WorkflowInstanceTest.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 183c56bf..1b72a0f5 100644 --- a/composer.json +++ b/composer.json @@ -15,15 +15,15 @@ } ], "require": { + "php": "^7.3 || ^8.0", "silverstripe/cms": "^4", - "silverstripe/framework": "^4", + "silverstripe/framework": "^4.10", "silverstripe/admin": "^1", "silverstripe/versioned": "^1", "symfony/yaml": "~3.2" }, "require-dev": { - "sminnee/phpunit": "^5.7", - "squizlabs/php_codesniffer": "^3" + "phpunit/phpunit": "^9.5" }, "extra": { "expose": [ diff --git a/tests/WorkflowEmbargoExpiryTest.php b/tests/WorkflowEmbargoExpiryTest.php index 9309eeaf..6419b2f5 100644 --- a/tests/WorkflowEmbargoExpiryTest.php +++ b/tests/WorkflowEmbargoExpiryTest.php @@ -27,7 +27,7 @@ class WorkflowEmbargoExpiryTest extends SapphireTest { protected static $fixture_file = 'WorkflowEmbargoExpiry.yml'; - protected function setUp() + protected function setUp(): void { // Prevent failure if queuedjobs module isn't installed. if (!class_exists(AbstractQueuedJob::class)) { @@ -43,7 +43,7 @@ protected function setUp() Config::modify()->set(QueuedJobService::class, 'use_shutdown_function', false); } - protected function tearDown() + protected function tearDown(): void { DBDatetime::clear_mock_now(); parent::tearDown(); diff --git a/tests/WorkflowEngineTest.php b/tests/WorkflowEngineTest.php index be4cb36b..96fc2e0e 100644 --- a/tests/WorkflowEngineTest.php +++ b/tests/WorkflowEngineTest.php @@ -147,7 +147,7 @@ public function testCreateDefinitionWithEmptyTitle() $definition = new WorkflowDefinition(); $definition->Title = ""; $definition->write(); - $this->assertContains( + $this->assertStringContainsString( 'My Workflow', $definition->Title, 'Workflow created without title is assigned a default title.' diff --git a/tests/WorkflowInstanceTest.php b/tests/WorkflowInstanceTest.php index b5ce83bb..b4a21d66 100644 --- a/tests/WorkflowInstanceTest.php +++ b/tests/WorkflowInstanceTest.php @@ -28,7 +28,7 @@ class WorkflowInstanceTest extends SapphireTest */ protected $currentMember; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->currentMember = $this->objFromFixture(Member::class, 'ApproverMember01');