From 3e84afef59620b4e1e20a8776a4e022fbdc6f438 Mon Sep 17 00:00:00 2001 From: Bart Jaskulski <bjaskulski@protonmail.com> Date: Thu, 29 Jun 2023 09:14:20 +0200 Subject: [PATCH] build: update packages and phpunit compatibitilty Signed-off-by: Bart Jaskulski <bjaskulski@protonmail.com> --- composer.json | 12 ++++++++---- phpunit-unit.xml | 16 +--------------- tests/unit/Test_Basic_Requirement_Checker.php | 4 ++-- ...c_Requirement_Checker_With_Update_Disable.php | 4 ++-- 4 files changed, 13 insertions(+), 23 deletions(-) diff --git a/composer.json b/composer.json index 0608e96..6f4ed92 100644 --- a/composer.json +++ b/composer.json @@ -11,12 +11,11 @@ }, "require-dev": { "php": ">=5.5", - "phpunit/phpunit": "<7", - "wp-coding-standards/wpcs": "^0.14.1", - "squizlabs/php_codesniffer": "^3.0.2", + "phpunit/phpunit": "^8 | ^9", "mockery/mockery": "*", "10up/wp_mock": "*", - "wimg/php-compatibility": "^8" + "wimg/php-compatibility": "^8", + "wpdesk/wp-code-sniffer": "^1.2" }, "autoload": { @@ -43,5 +42,10 @@ "phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage", "docs": "apigen generate" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/phpunit-unit.xml b/phpunit-unit.xml index 72701bb..f195510 100644 --- a/phpunit-unit.xml +++ b/phpunit-unit.xml @@ -1,21 +1,7 @@ <phpunit bootstrap="tests/unit/bootstrap.php"> <testsuites> - <testsuite> + <testsuite name="Unit Tests"> <directory prefix="Test_" suffix=".php">./tests/unit/</directory> </testsuite> </testsuites> - - <filter> - <whitelist> - <directory suffix=".php">src</directory> - </whitelist> - </filter> - - <logging> - <log type="junit" target="build-coverage/report.junit.xml"/> - <log type="coverage-html" target="build-coverage/coverage" charset="UTF-8" yui="true" highlight="true"/> - <log type="coverage-text" target="build-coverage/coverage.txt"/> - <log type="coverage-clover" target="build-coverage/clover.xml"/> - </logging> - </phpunit> \ No newline at end of file diff --git a/tests/unit/Test_Basic_Requirement_Checker.php b/tests/unit/Test_Basic_Requirement_Checker.php index 5d986ef..c254136 100644 --- a/tests/unit/Test_Basic_Requirement_Checker.php +++ b/tests/unit/Test_Basic_Requirement_Checker.php @@ -17,7 +17,7 @@ const ALWAYS_FUNCTION_EXISTS = 'function_exists'; - public function setUp() { + public function setUp(): void { WP_Mock::setUp(); WP_Mock::wpFunction( 'get_bloginfo' ) @@ -33,7 +33,7 @@ ->andReturn( self::ALWAYS_FUNCTION_EXISTS ); } - public function tearDown() { + public function tearDown(): void { WP_Mock::tearDown(); } diff --git a/tests/unit/Test_Basic_Requirement_Checker_With_Update_Disable.php b/tests/unit/Test_Basic_Requirement_Checker_With_Update_Disable.php index ce3d688..bf5974d 100644 --- a/tests/unit/Test_Basic_Requirement_Checker_With_Update_Disable.php +++ b/tests/unit/Test_Basic_Requirement_Checker_With_Update_Disable.php @@ -7,14 +7,14 @@ class Test_Basic_Requirement_Checker_With_Update_Disable extends PHPUnit\Framewo const ALWAYS_VALID_WP_VERSION = '4.0'; const RANDOM_PLUGIN_TEXTDOMAIN = 'text'; - public function setUp() { + public function setUp(): void { WP_Mock::setUp(); WP_Mock::wpFunction( 'get_bloginfo' ) ->andReturn( self::ALWAYS_VALID_WP_VERSION ); } - public function tearDown() { + public function tearDown(): void { WP_Mock::tearDown(); } -- GitLab