Skip to content
Snippets Groups Projects
Verified Commit 3e84afef authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

build: update packages and phpunit compatibitilty


Signed-off-by: default avatarBart Jaskulski <bjaskulski@protonmail.com>
parent db0c8887
No related branches found
No related tags found
No related merge requests found
...@@ -11,12 +11,11 @@ ...@@ -11,12 +11,11 @@
}, },
"require-dev": { "require-dev": {
"php": ">=5.5", "php": ">=5.5",
"phpunit/phpunit": "<7", "phpunit/phpunit": "^8 | ^9",
"wp-coding-standards/wpcs": "^0.14.1",
"squizlabs/php_codesniffer": "^3.0.2",
"mockery/mockery": "*", "mockery/mockery": "*",
"10up/wp_mock": "*", "10up/wp_mock": "*",
"wimg/php-compatibility": "^8" "wimg/php-compatibility": "^8",
"wpdesk/wp-code-sniffer": "^1.2"
}, },
"autoload": { "autoload": {
...@@ -43,5 +42,10 @@ ...@@ -43,5 +42,10 @@
"phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage", "phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage",
"docs": "apigen generate" "docs": "apigen generate"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
} }
} }
<phpunit bootstrap="tests/unit/bootstrap.php"> <phpunit bootstrap="tests/unit/bootstrap.php">
<testsuites> <testsuites>
<testsuite> <testsuite name="Unit Tests">
<directory prefix="Test_" suffix=".php">./tests/unit/</directory> <directory prefix="Test_" suffix=".php">./tests/unit/</directory>
</testsuite> </testsuite>
</testsuites> </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> </phpunit>
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
const ALWAYS_FUNCTION_EXISTS = 'function_exists'; const ALWAYS_FUNCTION_EXISTS = 'function_exists';
public function setUp() { public function setUp(): void {
WP_Mock::setUp(); WP_Mock::setUp();
WP_Mock::wpFunction( 'get_bloginfo' ) WP_Mock::wpFunction( 'get_bloginfo' )
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
->andReturn( self::ALWAYS_FUNCTION_EXISTS ); ->andReturn( self::ALWAYS_FUNCTION_EXISTS );
} }
public function tearDown() { public function tearDown(): void {
WP_Mock::tearDown(); WP_Mock::tearDown();
} }
......
...@@ -7,14 +7,14 @@ class Test_Basic_Requirement_Checker_With_Update_Disable extends PHPUnit\Framewo ...@@ -7,14 +7,14 @@ class Test_Basic_Requirement_Checker_With_Update_Disable extends PHPUnit\Framewo
const ALWAYS_VALID_WP_VERSION = '4.0'; const ALWAYS_VALID_WP_VERSION = '4.0';
const RANDOM_PLUGIN_TEXTDOMAIN = 'text'; const RANDOM_PLUGIN_TEXTDOMAIN = 'text';
public function setUp() { public function setUp(): void {
WP_Mock::setUp(); WP_Mock::setUp();
WP_Mock::wpFunction( 'get_bloginfo' ) WP_Mock::wpFunction( 'get_bloginfo' )
->andReturn( self::ALWAYS_VALID_WP_VERSION ); ->andReturn( self::ALWAYS_VALID_WP_VERSION );
} }
public function tearDown() { public function tearDown(): void {
WP_Mock::tearDown(); WP_Mock::tearDown();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment