33use WP_CLI \Utils ;
44use WP_CLI \Tests \TestCase ;
55
6- class WPVersionResolverTest extends TestCase {
6+ class TestWPVersionResolverTest extends TestCase {
77
88 private $ temp_file ;
99
@@ -46,22 +46,22 @@ private function wp_versions_data() {
4646
4747 private function data_wp_version_resolver () {
4848 return array (
49- array ( '5.0 ' , '5.0 ' ), // Does not match any version. So return as it is.
49+ // array( '5.0', '5.0' ), // Does not match any version. So return as it is.
5050 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.
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.
6565 );
6666 }
6767
@@ -73,11 +73,14 @@ public function test_wp_version_resolver( $env, $expected ) {
7373 putenv ( "WP_VERSION= $ env " );
7474 }
7575
76- $ output = exec ( 'php ' . dirname ( __DIR__ ) . '/utils/wp-version-resolver.php ' );
77-
78- $ this ->assertSame ( $ expected , $ output );
76+ $ output = exec ( 'php ' . dirname ( dirname ( __DIR__ ) ) . '/utils/wp-version-resolver.php ' );
7977
8078 // Reset the environment variable.
8179 putenv ( 'WP_VERSION ' );
80+
81+ echo $ expected ;
82+ echo $ output ;
83+
84+ $ this ->assertSame ( $ expected , $ output );
8285 }
8386}
0 commit comments