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/WorkflowImportExportTest.php b/tests/WorkflowImportExportTest.php index ead0eb3f..f50a4ea5 100644 --- a/tests/WorkflowImportExportTest.php +++ b/tests/WorkflowImportExportTest.php @@ -13,6 +13,7 @@ use Symbiote\AdvancedWorkflow\DataObjects\WorkflowDefinition; use Symbiote\AdvancedWorkflow\DataObjects\WorkflowTransition; use Symbiote\AdvancedWorkflow\Templates\WorkflowTemplate; +use SilverStripe\ORM\ValidationException; /** * Tests for workflow import/export logic. @@ -109,7 +110,8 @@ public function testFormatWithoutActions() public function testParseBadYAMLNoHeaderImport() { $importer = new WorkflowDefinitionImporter(); - $this->setExpectedException('Exception', 'Invalid YAML format.'); + $this->expectException(\Exception::class); + $this->expectExceptionMessage('Invalid YAML format.'); $source = <<<'EOD' SilverStripe\Core\Injector\Injector\Injector: ExportedWorkflow: @@ -143,7 +145,8 @@ class: Symbiote\AdvancedWorkflow\Templates\WorkflowTemplate public function testParseBadYAMLMalformedImport() { $importer = new WorkflowDefinitionImporter(); - $this->setExpectedException('SilverStripe\\ORM\\ValidationException', 'Invalid YAML format. Unable to parse.'); + $this->expectException(ValidationException::class); + $this->expectExceptionMessage('Invalid YAML format. Unable to parse.'); $source = <<<'EOD' --- Name: exportedworkflow @@ -256,7 +259,7 @@ public function testGetImportedWorkflowsMany() $imports = $importer->getImportedWorkflows(); $this->assertNotEmpty($imports); - $this->assertInternalType('array', $imports); + $this->assertIsArray($imports); $this->assertGreaterThan(1, count($imports)); } } 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');