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

Merge branch 'bugfix/comparison'

parents db0c8887 71a1767e
No related branches found
No related tags found
No related merge requests found
Pipeline #217431 passed with warnings
## [3.6.2] - 2023-06-29
### Fixed
- Exact comparison for X.Y.Z semver version doesn't result in notices when the required version is met. Previously, requiring plugin in 1.1.1 version and activating dependend plugin in such version would result in admin notice and disabling the plugin, actually letting to use the plugin only from 1.1.2 version.
## [3.6.1] - 2023-06-22 ## [3.6.1] - 2023-06-22
### Changed ### Changed
- Plugin info transient changed to auto loaded option - Plugin info transient changed to auto loaded option
......
...@@ -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
...@@ -333,7 +333,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { ...@@ -333,7 +333,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
$required_plugins = $this->retrieve_required_plugins_data(); $required_plugins = $this->retrieve_required_plugins_data();
if ( count( $required_plugins ) > 0 ) { if ( count( $required_plugins ) > 0 ) {
foreach ( $required_plugins as $plugin ) { foreach ( $required_plugins as $plugin ) {
if ( version_compare( $plugin['Version'], $plugin[ self::PLUGIN_INFO_APPEND_PLUGIN_DATA ], '<' ) ) { if ( version_compare( $plugin['Version'], $plugin[ self::PLUGIN_INFO_APPEND_PLUGIN_DATA ], '<=' ) ) {
$notices[] = $this->prepare_notice_message( $notices[] = $this->prepare_notice_message(
sprintf( sprintf(
__( 'The &#8220;%1$s&#8221; plugin requires at least %2$s version of %3$s to work correctly. Please update it to its latest release.', $this->get_text_domain() ), __( 'The &#8220;%1$s&#8221; plugin requires at least %2$s version of %3$s to work correctly. Please update it to its latest release.', $this->get_text_domain() ),
......
...@@ -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.
Please register or to comment