Skip to content

Commit 676c918

Browse files
committed
undo some changes
1 parent 3456a02 commit 676c918

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

src/Context/FeatureContext.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ private static function get_behat_internal_variables(): array {
559559
*/
560560
private static function download_sqlite_plugin( $dir ): void {
561561
$download_url = 'https://downloads.wordpress.org/plugin/sqlite-database-integration.zip';
562-
$download_location = $dir . DIRECTORY_SEPARATOR . 'sqlite-database-integration.zip';
562+
$download_location = $dir . '/sqlite-database-integration.zip';
563563

564564
if ( ! is_dir( $dir ) ) {
565565
mkdir( $dir );
@@ -623,16 +623,16 @@ private static function configure_sqlite( $dir ): void {
623623
private static function cache_wp_files(): void {
624624
$wp_version = getenv( 'WP_VERSION' );
625625
$wp_version_suffix = ( false !== $wp_version ) ? "-$wp_version" : '';
626-
self::$cache_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'wp-cli-test-core-download-cache' . $wp_version_suffix;
627-
self::$sqlite_cache_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'wp-cli-test-sqlite-integration-cache';
626+
self::$cache_dir = sys_get_temp_dir() . '/wp-cli-test-core-download-cache' . $wp_version_suffix;
627+
self::$sqlite_cache_dir = sys_get_temp_dir() . '/wp-cli-test-sqlite-integration-cache';
628628

629629
if ( 'sqlite' === getenv( 'WP_CLI_TEST_DBTYPE' ) ) {
630-
if ( ! is_readable( self::$sqlite_cache_dir . DIRECTORY_SEPARATOR . 'sqlite-database-integration/db.copy' ) ) {
630+
if ( ! is_readable( self::$sqlite_cache_dir . '/sqlite-database-integration/db.copy' ) ) {
631631
self::download_sqlite_plugin( self::$sqlite_cache_dir );
632632
}
633633
}
634634

635-
if ( is_readable( self::$cache_dir . DIRECTORY_SEPARATOR . 'wp-config-sample.php' ) ) {
635+
if ( is_readable( self::$cache_dir . '/wp-config-sample.php' ) ) {
636636
return;
637637
}
638638

@@ -666,7 +666,7 @@ public static function prepare( BeforeSuiteScope $scope ): void {
666666
// Remove install cache if any (not setting the static var).
667667
$wp_version = getenv( 'WP_VERSION' );
668668
$wp_version_suffix = ( false !== $wp_version ) ? "-$wp_version" : '';
669-
$install_cache_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'wp-cli-test-core-install-cache' . $wp_version_suffix;
669+
$install_cache_dir = sys_get_temp_dir() . '/wp-cli-test-core-install-cache' . $wp_version_suffix;
670670
if ( file_exists( $install_cache_dir ) ) {
671671
self::remove_dir( $install_cache_dir );
672672
}
@@ -793,7 +793,7 @@ public static function create_cache_dir(): string {
793793
if ( self::$suite_cache_dir ) {
794794
self::remove_dir( self::$suite_cache_dir );
795795
}
796-
self::$suite_cache_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid( 'wp-cli-test-suite-cache-' . self::$temp_dir_infix . '-', true );
796+
self::$suite_cache_dir = sys_get_temp_dir() . '/' . uniqid( 'wp-cli-test-suite-cache-' . self::$temp_dir_infix . '-', true );
797797
mkdir( self::$suite_cache_dir );
798798
return self::$suite_cache_dir;
799799
}
@@ -1015,7 +1015,7 @@ private static function get_event_file( $scope, &$line ): ?string {
10151015
*/
10161016
public function create_run_dir(): void {
10171017
if ( ! isset( $this->variables['RUN_DIR'] ) ) {
1018-
self::$run_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid( 'wp-cli-test-run-' . self::$temp_dir_infix . '-', true );
1018+
self::$run_dir = sys_get_temp_dir() . '/' . uniqid( 'wp-cli-test-run-' . self::$temp_dir_infix . '-', true );
10191019
$this->variables['RUN_DIR'] = self::$run_dir;
10201020
mkdir( $this->variables['RUN_DIR'] );
10211021
}
@@ -1025,7 +1025,7 @@ public function create_run_dir(): void {
10251025
* @param string $version
10261026
*/
10271027
public function build_phar( $version = 'same' ): void {
1028-
$this->variables['PHAR_PATH'] = $this->variables['RUN_DIR'] . DIRECTORY_SEPARATOR . uniqid( 'wp-cli-build-', true ) . '.phar';
1028+
$this->variables['PHAR_PATH'] = $this->variables['RUN_DIR'] . '/' . uniqid( 'wp-cli-build-', true ) . '.phar';
10291029

10301030
$is_bundle = false;
10311031

@@ -1094,7 +1094,7 @@ public function download_phar( $version = 'same' ): void {
10941094
* CACHE_DIR is a cache for downloaded test data such as images. Lives until manually deleted.
10951095
*/
10961096
private function set_cache_dir(): void {
1097-
$path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'wp-cli-test-cache';
1097+
$path = sys_get_temp_dir() . '/wp-cli-test-cache';
10981098
if ( ! file_exists( $path ) ) {
10991099
mkdir( $path );
11001100
}
@@ -1277,7 +1277,7 @@ public static function remove_dir( $dir ): void {
12771277
continue;
12781278
}
12791279

1280-
self::remove_dir( $dir . DIRECTORY_SEPARATOR . $item );
1280+
self::remove_dir( $dir . '/' . $item );
12811281
}
12821282

12831283
rmdir( $dir );
@@ -1296,7 +1296,7 @@ public static function copy_dir( $src_dir, $dest_dir ): void {
12961296
);
12971297

12981298
foreach ( $iterator as $item ) {
1299-
$dest_path = $dest_dir . DIRECTORY_SEPARATOR . $iterator->getSubPathname();
1299+
$dest_path = $dest_dir . '/' . $iterator->getSubPathname();
13001300
if ( $item->isDir() ) {
13011301
if ( ! is_dir( $dest_path ) ) {
13021302
mkdir( $dest_path, 0777, true );
@@ -1400,7 +1400,7 @@ public function create_config( $subdir = '', $extra_php = false ): void {
14001400
public function install_wp( $subdir = '' ): void {
14011401
$wp_version = getenv( 'WP_VERSION' );
14021402
$wp_version_suffix = ( false !== $wp_version ) ? "-$wp_version" : '';
1403-
self::$install_cache_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'wp-cli-test-core-install-cache' . $wp_version_suffix;
1403+
self::$install_cache_dir = sys_get_temp_dir() . '/wp-cli-test-core-install-cache' . $wp_version_suffix;
14041404
if ( ! file_exists( self::$install_cache_dir ) ) {
14051405
mkdir( self::$install_cache_dir );
14061406
}
@@ -1513,17 +1513,17 @@ public function install_wp_with_composer( $vendor_directory = 'vendor' ): void {
15131513

15141514
public function composer_add_wp_cli_local_repository(): void {
15151515
if ( ! self::$composer_local_repository ) {
1516-
self::$composer_local_repository = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid( 'wp-cli-composer-local-', true );
1516+
self::$composer_local_repository = sys_get_temp_dir() . '/' . uniqid( 'wp-cli-composer-local-', true );
15171517
mkdir( self::$composer_local_repository );
15181518

15191519
$env = self::get_process_env_variables();
15201520
$src = $env['TRAVIS_BUILD_DIR'] ?? realpath( self::get_vendor_dir() . '/../' );
15211521

1522-
self::copy_dir( $src, self::$composer_local_repository . DIRECTORY_SEPARATOR );
1523-
self::remove_dir( self::$composer_local_repository . DIRECTORY_SEPARATOR . '.git' );
1524-
self::remove_dir( self::$composer_local_repository . DIRECTORY_SEPARATOR . 'vendor' );
1522+
self::copy_dir( $src, self::$composer_local_repository . '/' );
1523+
self::remove_dir( self::$composer_local_repository . '/.git' );
1524+
self::remove_dir( self::$composer_local_repository . '/vendor' );
15251525
}
1526-
$dest = self::$composer_local_repository . DIRECTORY_SEPARATOR;
1526+
$dest = self::$composer_local_repository . '/';
15271527
$this->composer_command( "config repositories.wp-cli '{\"type\": \"path\", \"url\": \"$dest\", \"options\": {\"symlink\": false, \"versions\": { \"wp-cli/wp-cli\": \"dev-main\"}}}'" );
15281528
$this->variables['COMPOSER_LOCAL_REPOSITORY'] = self::$composer_local_repository;
15291529
}

tests/tests/TestBehatTags.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ protected function set_up(): void {
2020
$this->temp_dir = Utils\get_temp_dir() . uniqid( 'wp-cli-test-behat-tags-', true );
2121
mkdir( $this->temp_dir );
2222
mkdir( $this->temp_dir . '/features' );
23-
24-
$this->temp_dir = realpath( $this->temp_dir );
2523
}
2624

2725
protected function tear_down(): void {
@@ -179,7 +177,7 @@ public function test_behat_tags_extension(): void {
179177

180178
putenv( 'GITHUB_TOKEN' );
181179

182-
$behat_tags = realpath( dirname( dirname( __DIR__ ) ) . '/utils/behat-tags.php' );
180+
$behat_tags = dirname( dirname( __DIR__ ) ) . '/utils/behat-tags.php';
183181

184182
file_put_contents( $this->temp_dir . '/features/extension.feature', '@require-extension-imagick @require-extension-curl' );
185183

@@ -219,7 +217,7 @@ public function test_behat_tags_extension(): void {
219217
public function test_behat_tags_db_version(): void {
220218
$db_type = getenv( 'WP_CLI_TEST_DBTYPE' );
221219

222-
$behat_tags = realpath( dirname( dirname( __DIR__ ) ) . '/utils/behat-tags.php' );
220+
$behat_tags = dirname( dirname( __DIR__ ) ) . '/utils/behat-tags.php';
223221

224222
// Just to get the get_db_version() function.
225223
ob_start();

0 commit comments

Comments
 (0)