Skip to content

Commit

Permalink
fix prerelease check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed Feb 6, 2024
1 parent 3fa3de7 commit 3a3a647
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/phpunit/test-pantheon-updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,13 @@ private static function is_prerelease() {
$current_version = _pantheon_get_current_wordpress_version();
$installed_version = self::get_latest_wp_version_from_file();

if ( version_compare( $current_version, $installed_version, '>=' ) ) {
// If the current version and the installed version are the same, then we're not using a prerelease.
if ( $current_version === $installed_version ) {
return false;
}

// If the version derived from wordpress is higher than the version in the wp-version.json file, then we're using a prerelease.
if ( version_compare( $current_version, $installed_version, '>' ) ) {
return true;
}

Expand Down

0 comments on commit 3a3a647

Please sign in to comment.