diff --git a/composer.json b/composer.json index 0608e96b8d1e3759036e00f57694937d0097a028..6f4ed92a5db219fbabb902e545b48e7dc204ffda 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 72701bbecbc7b15b8b408ee193a74a0f131d5615..f1955101fc471526ad82025876dced1b537f33ec 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 5d986ef304a56b0695c6c8f27c4cf12f28f1400e..c2541369c9c85e3d6272867835e6e312a491572b 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 ce3d688f1ea514b93196ae8b8800729fa511847a..bf5974d8d3fe27b6f14faf3542a80cad9dad5b3d 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(); }