Skip to content

Commit df2d133

Browse files
committed
Update test cases for minor version assertions
1 parent 4dc3431 commit df2d133

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

tests/tests/TestWPVersionResolverTest.php

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ protected function tear_down() {
2727

2828
private function wp_versions_data() {
2929
return array(
30+
'5.4' => 'insecure',
3031
'5.9' => 'insecure',
3132
'5.9.1' => 'insecure',
3233
'5.9.2' => 'insecure',
@@ -46,22 +47,22 @@ private function wp_versions_data() {
4647

4748
private function data_wp_version_resolver() {
4849
return array(
49-
// array( '5.0', '5.0' ), // Does not match any version. So return as it is.
50-
array( '5', '6.5.2' ), // Return the latest major version.
51-
// array( '5.9', '5.9.2' ), // Return the latest patch version.
52-
// array( '5.9.1', '5.9.1' ), // Return the exact version.
53-
// array( '6', '6.5.2' ), // Return the latest minor version.
54-
// array( '6.0', '6.0.2' ), // Return the latest patch version.
55-
// array( '6.0.0', '6.0' ), // Return the requested version.
56-
// array( '', '6.5.2' ), // Return the latest version.
57-
// array( 'latest', '6.5.2' ), // Return the latest version.
58-
// array( 'some-mismatched-version', 'some-mismatched-version' ), // Does not match any version. So return as it is.
59-
// array( '6.5-alpha', '6.5.2' ), // Return the latest version.
60-
// array( '6.5-beta', '6.5.2' ), // Return the latest version.
61-
// array( '6.5-rc', '6.5.2' ), // Return the latest version.
62-
// array( '6.5-nightly', '6.5-nightly' ), // Does not match any version. So return as it is.
63-
// array( '6.5.0.0', '6.5' ), // Return the latest version.
64-
// array( '6.5.2.0', '6.5.2' ), // Return the latest version.
50+
array( '5.0', '5.0' ), // Does not match any version. So return as it is.
51+
array( '5', '5.9.2' ), // Return the latest major version.
52+
array( '5.9', '5.9.2' ), // Return the latest patch version.
53+
array( '5.9.1', '5.9.1' ), // Return the exact version.
54+
array( '6', '6.5.2' ), // Return the latest minor version.
55+
array( '6.0', '6.0.2' ), // Return the latest patch version.
56+
array( '6.0.0', '6.0' ), // Return the requested version.
57+
array( '', '6.5.2' ), // Return the latest version.
58+
array( 'latest', '6.5.2' ), // Return the latest version.
59+
array( 'some-mismatched-version', 'some-mismatched-version' ), // Does not match any version. So return as it is.
60+
array( '6.5-alpha', '6.5.2' ), // Return the latest version.
61+
array( '6.5-beta', '6.5.2' ), // Return the latest version.
62+
array( '6.5-rc', '6.5.2' ), // Return the latest version.
63+
array( '6.5-nightly', '6.5-nightly' ), // Does not match any version. So return as it is.
64+
array( '6.5.0.0', '6.5' ), // Return the latest version.
65+
array( '6.5.2.0', '6.5.2' ), // Return the latest version.
6566
);
6667
}
6768

@@ -78,9 +79,6 @@ public function test_wp_version_resolver( $env, $expected ) {
7879
// Reset the environment variable.
7980
putenv( 'WP_VERSION' );
8081

81-
echo $expected;
82-
echo $output;
83-
8482
$this->assertSame( $expected, $output );
8583
}
8684
}

0 commit comments

Comments
 (0)