Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions tests/phpunit/tests/multisite/cleanDirsizeCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ public function test_get_dirsize_cache_in_recurse_dirsize_upload() {
public function test_pre_recurse_dirsize_filter() {
add_filter( 'pre_recurse_dirsize', array( $this, 'filter_pre_recurse_dirsize' ) );

$upload_dir = wp_upload_dir();
$this->assertSame( 1042, recurse_dirsize( $upload_dir['path'] ) );
$directory_cache = array();
$this->assertSame( 1042, recurse_dirsize( __DIR__, null, null, $directory_cache ) );

remove_filter( 'pre_recurse_dirsize', array( $this, 'filter_pre_recurse_dirsize' ) );
}
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/tests/multisite/network.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Tests_Multisite_Network extends WP_UnitTestCase {
public function tear_down() {
global $current_site;
$current_site->id = 1;
wp_installing( false );
parent::tear_down();
}

Expand Down
5 changes: 3 additions & 2 deletions tests/phpunit/tests/multisite/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function set_up() {
public function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
wp_installing( false );
parent::tear_down();
}

Expand Down Expand Up @@ -2052,7 +2053,7 @@ public function test_wp_initialize_site_empty_id() {
* @ticket 41333
*/
public function test_wp_initialize_site_invalid_id() {
$result = wp_initialize_site( 123 );
$result = wp_initialize_site( PHP_INT_MAX );
$this->assertWPError( $result );
$this->assertSame( 'site_invalid_id', $result->get_error_code() );
}
Expand Down Expand Up @@ -2090,7 +2091,7 @@ public function test_wp_uninitialize_site_empty_id() {
* @ticket 41333
*/
public function test_wp_uninitialize_site_invalid_id() {
$result = wp_uninitialize_site( 123 );
$result = wp_uninitialize_site( PHP_INT_MAX );
$this->assertWPError( $result );
$this->assertSame( 'site_invalid_id', $result->get_error_code() );
}
Expand Down
4 changes: 4 additions & 0 deletions tests/phpunit/tests/multisite/siteMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ public function test_lazy_load_site_meta() {
$this->markTestSkipped( 'Test only runs with the blogmeta database table installed.' );
}

$this->reset_lazyload_queue();

$filter = new MockAction();
add_filter( 'update_blog_metadata_cache', array( $filter, 'filter' ), 10, 2 );

Expand Down Expand Up @@ -294,6 +296,8 @@ public function test_lazy_load_site_meta_fields_id() {
$this->markTestSkipped( 'Test only runs with the blogmeta database table installed.' );
}

$this->reset_lazyload_queue();

$filter = new MockAction();
add_filter( 'update_blog_metadata_cache', array( $filter, 'filter' ), 10, 2 );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5583,7 +5583,7 @@ public function test_create_item_from_url_exceeds_multisite_site_upload_space()
add_filter( 'pre_http_request', array( $this, 'mock_image_download' ), 10, 3 );

$request = new WP_REST_Request( 'POST', '/wp/v2/media' );
$request->set_param( 'url', 'https://example.com/no-space.jpg' );
$request->set_param( 'url', home_url( '/no-space.jpg' ) );
$request->set_param( 'generate_sub_sizes', false );

$response = rest_get_server()->dispatch( $request );
Expand Down
Loading