Changeset 61423
- Timestamp:
- 01/02/2026 10:10:33 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/populateNetworkHooks.php
r61420 r61423 57 57 ); 58 58 59 remove_action( 'before_populate_network', array( $this, 'hook_action_counter' ), 10 ); 60 remove_action( 'after_populate_network', array( $this, 'hook_action_counter' ), 10 ); 61 62 global $wpdb; 63 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->sitemeta} WHERE site_id = %d", $network_id ) ); 64 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->site} WHERE id = %d", $network_id ) ); 65 59 66 $this->assertSame( 1, $this->action_counts['before_populate_network'], 'before_populate_network action should fire once' ); 60 67 $this->assertSame( 1, $this->action_counts['after_populate_network'], 'after_populate_network action should fire once' ); … … 64 71 $this->assertSame( $network_id, $this->action_args['after_populate_network']['network_id'], 'Network ID should match in after_populate_network hook' ); 65 72 $this->assertSame( $domain, $this->action_args['after_populate_network']['domain'], 'Domain should match in after_populate_network hook' ); 66 67 remove_action( 'before_populate_network', array( $this, 'hook_action_counter' ), 10 );68 remove_action( 'after_populate_network', array( $this, 'hook_action_counter' ), 10 );69 70 global $wpdb;71 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->sitemeta} WHERE site_id = %d", $network_id ) );72 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->site} WHERE id = %d", $network_id ) );73 73 } 74 74 … … 91 91 ); 92 92 93 $this->assertTrue( $this->hook_called, 'The modify_domain_hook action should have been called' );94 95 93 remove_action( 'before_populate_network', array( $this, 'modify_domain_hook' ), 10 ); 96 94 … … 98 96 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->sitemeta} WHERE site_id = %d", $network_id ) ); 99 97 $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->site} WHERE id = %d", $network_id ) ); 98 99 $this->assertTrue( $this->hook_called, 'The modify_domain_hook action should have been called' ); 100 100 } 101 101
Note: See TracChangeset
for help on using the changeset viewer.