Skip to content

Commit 358cf51

Browse files
committed
test tweak
1 parent fabdeab commit 358cf51

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/phpunit/wpmatomo/test-paths.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,14 @@ public function test_get_global_path_upload_dir_if_matches_site_specific_dir() {
244244

245245
$blogid1 = self::factory()->blog->create();
246246
switch_to_blog( 2 );
247-
wp_delete_site( $blogid1 );
248247

249-
$upload_path_base_dir = $this->paths->get_upload_base_dir();
248+
try {
249+
$upload_path_base_dir = $this->paths->get_upload_base_dir();
250250

251-
$global_upload_path = $this->paths->get_global_path_upload_dir_if_matches_site_specific_dir( $upload_path_base_dir );
252-
$this->assertEquals( ABSPATH . 'wp-content/uploads/', $global_upload_path );
251+
$global_upload_path = $this->paths->get_global_path_upload_dir_if_matches_site_specific_dir( $upload_path_base_dir );
252+
$this->assertEquals( ABSPATH . 'wp-content/uploads/', $global_upload_path );
253+
} finally {
254+
wp_delete_site( $blogid1 );
255+
}
253256
}
254257
}

0 commit comments

Comments
 (0)