Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
bc4104f
Add a cleanup function under unzip file tests.
aslamdoctor May 14, 2025
880100b
move cleanup function to abstract-testcase.php to maintain dry
aslamdoctor May 14, 2025
f5d9185
add ticket reference in comments
aslamdoctor May 14, 2025
cb8c0a4
include cleanup function under test_should_apply_pre_unzip_file_filte…
aslamdoctor May 15, 2025
d7134cd
add fullstop on inline comments
aslamdoctor May 16, 2025
344925a
Cleanup to Clean up
t-hamano Nov 7, 2025
71f8242
cleanup_unzip_destination to clean_up_unzip_destination
t-hamano Nov 7, 2025
b0b96ed
cleanup_unzip_destination to clean_up_unzip_destination
t-hamano Nov 7, 2025
a21d279
cleanup_unzip_destination to clean_up_unzip_destination
t-hamano Nov 7, 2025
0b01596
cleanup_unzip_destination to clean_up_unzip_destination, fix wrogn ti…
t-hamano Nov 7, 2025
a852774
cleanup_unzip_destination to clean_up_unzip_destination
t-hamano Nov 7, 2025
574cdad
cleanup_unzip_destination to clean_up_unzip_destination, fix wrogn ti…
t-hamano Nov 7, 2025
379e81c
cleanup_unzip_destination to clean_up_unzip_destination
t-hamano Nov 7, 2025
b5ecebe
cleanup_unzip_destination to clean_up_unzip_destination
t-hamano Nov 7, 2025
fafa8c6
cleanup_unzip_destination to clean_up_unzip_destination
t-hamano Nov 7, 2025
b8041f3
Merge branch 'trunk' into 63443-zip-tests-not-checking-potential-clea…
t-hamano Nov 7, 2025
8bcd8c1
Merge branch 'trunk' into 63443-zip-tests-not-checking-potential-clea…
peterwilsoncc Nov 10, 2025
200ccee
Update tests/phpunit/includes/abstract-testcase.php
t-hamano Nov 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/phpunit/includes/abstract-testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1864,4 +1864,18 @@ private function retry_on_error( callable $callback, $url, $args ) {

return $result;
}

/**
* Clean up the unzip destination.
*
* @since 6.9.0
*
* @param string $unzip_destination Unzip destination.
*/
public function clean_up_unzip_destination( $unzip_destination ) {
if ( file_exists( $unzip_destination ) ) {
$this->rmdir( $unzip_destination );
$this->delete_folders( $unzip_destination );
}
}
}
8 changes: 4 additions & 4 deletions tests/phpunit/tests/filesystem/unzipFilePclzip.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ public function test_should_apply_pre_unzip_file_filters() {

// Prepare test environment.
$unzip_destination = self::$test_data_dir . 'archive/';
$this->clean_up_unzip_destination( $unzip_destination ); // See #63443 for details.
mkdir( $unzip_destination );

_unzip_file_pclzip( self::$test_data_dir . 'archive.zip', $unzip_destination );

// Cleanup test environment.
$this->rmdir( $unzip_destination );
$this->delete_folders( $unzip_destination );
$this->clean_up_unzip_destination( $unzip_destination );

$this->assertSame( 1, $filter->get_call_count() );
}
Expand All @@ -63,13 +63,13 @@ public function test_should_apply_unzip_file_filters() {

// Prepare test environment.
$unzip_destination = self::$test_data_dir . 'archive/';
$this->clean_up_unzip_destination( $unzip_destination ); // See #63443 for details.
mkdir( $unzip_destination );

_unzip_file_pclzip( self::$test_data_dir . 'archive.zip', $unzip_destination );

// Cleanup test environment.
$this->rmdir( $unzip_destination );
$this->delete_folders( $unzip_destination );
$this->clean_up_unzip_destination( $unzip_destination );

$this->assertSame( 1, $filter->get_call_count() );
}
Expand Down
8 changes: 4 additions & 4 deletions tests/phpunit/tests/filesystem/unzipFileZiparchive.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public function test_should_apply_pre_unzip_file_filters() {

// Prepare test environment.
$unzip_destination = self::$test_data_dir . 'archive/';
$this->clean_up_unzip_destination( $unzip_destination ); // See #63443 for details.
mkdir( $unzip_destination );

_unzip_file_ziparchive( self::$test_data_dir . 'archive.zip', $unzip_destination );

// Cleanup test environment.
$this->rmdir( $unzip_destination );
$this->delete_folders( $unzip_destination );
$this->clean_up_unzip_destination( $unzip_destination );

$this->assertSame( 1, $filter->get_call_count() );
}
Expand All @@ -71,13 +71,13 @@ public function test_should_apply_unzip_file_filters() {

// Prepare test environment.
$unzip_destination = self::$test_data_dir . 'archive/';
$this->clean_up_unzip_destination( $unzip_destination ); // See #65443 for details.
mkdir( $unzip_destination );

_unzip_file_ziparchive( self::$test_data_dir . 'archive.zip', $unzip_destination );

// Cleanup test environment.
$this->rmdir( $unzip_destination );
$this->delete_folders( $unzip_destination );
$this->clean_up_unzip_destination( $unzip_destination );

$this->assertSame( 1, $filter->get_call_count() );
}
Expand Down
Loading