From be25331a75e992705f635b47c375befa45bd8f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C4=8Curdinjakovi=C4=87?= Date: Thu, 27 Apr 2023 14:21:59 +0200 Subject: [PATCH] [feature/systemsdev-3038] Minimal changes to get to PHP 8.0 compatibility. --- composer.json | 8 +++++++- phpunit/otgs-testcase.php | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 4b86972..8b1ae6c 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "lucatume/function-mocker": "^1.3", "symfony/dom-crawler": "^5.0", "symfony/css-selector": "^5.0", - "phpunit/phpunit": "^7.5" + "phpunit/phpunit": "^8.5" }, "autoload": { "classmap": [ @@ -30,5 +30,11 @@ "phpunit/Mocks", "phpunit/stubs" ] + }, + "config": { + "sort-packages": true, + "platform": { + "php": "7.4" + } } } diff --git a/phpunit/otgs-testcase.php b/phpunit/otgs-testcase.php index acadea7..cbd43ca 100644 --- a/phpunit/otgs-testcase.php +++ b/phpunit/otgs-testcase.php @@ -24,19 +24,19 @@ abstract class OTGS_TestCase extends PHPUnit\Framework\TestCase { /** @var LegacyWPCore */ protected $mocked_wp_core_functions; - public static function setupBeforeClass() { + public static function setupBeforeClass(): void { $_GET = array(); $_POST = array(); } - public function setUp() { + public function setUp(): void { FunctionMocker::setUp(); parent::setUp(); WP_Mock::setUp(); $this->stubs = new OTGS_Stubs( $this ); } - public function tearDown() { + public function tearDown(): void { unset( $this->stubs ); WP_Mock::tearDown(); Mockery::close();