From 46169f71a0a2629ef928fa70b702ad85aeccbca7 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 27 Oct 2021 18:14:42 +1300 Subject: [PATCH] API phpunit 9 support --- composer.json | 5 +++-- phpunit.xml.dist | 8 +++++--- tests/EditableSpamProtectionFieldTest.php | 4 ++-- tests/FormSpamProtectionExtensionTest.php | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index ce0f2a7..e40c309 100644 --- a/composer.json +++ b/composer.json @@ -17,10 +17,11 @@ } ], "require": { - "silverstripe/framework": "^4.0" + "php": "^7.3 || ^8.0", + "silverstripe/framework": "^4.10" }, "require-dev": { - "sminnee/phpunit": "^5.7", + "phpunit/phpunit": "^9.5", "silverstripe/versioned": "^1.0", "squizlabs/php_codesniffer": "^3.0" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index adb1fb0..45fd549 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,9 @@ - - tests - + + + tests + + diff --git a/tests/EditableSpamProtectionFieldTest.php b/tests/EditableSpamProtectionFieldTest.php index 11010b0..0741db8 100644 --- a/tests/EditableSpamProtectionFieldTest.php +++ b/tests/EditableSpamProtectionFieldTest.php @@ -17,7 +17,7 @@ class EditableSpamProtectionFieldTest extends SapphireTest { protected $usesDatabase = true; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -115,7 +115,7 @@ class EditableSpamProtectionFieldTest extends SapphireTest { $field = new EditableSpamProtectionField; - $this->assertContains('/images/editablespamprotectionfield.png', $field->getIcon()); + $this->assertStringContainsString('/images/editablespamprotectionfield.png', $field->getIcon()); } protected function getFormMock() diff --git a/tests/FormSpamProtectionExtensionTest.php b/tests/FormSpamProtectionExtensionTest.php index 08e2c31..38d6071 100644 --- a/tests/FormSpamProtectionExtensionTest.php +++ b/tests/FormSpamProtectionExtensionTest.php @@ -25,7 +25,7 @@ class FormSpamProtectionExtensionTest extends SapphireTest */ protected $form = null; - protected function setUp() + protected function setUp(): void { parent::setUp();