- Timestamp:
- 04/09/2025 01:29:39 PM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/wpmuLogNewRegistrations.php
r54726 r60148 1 1 <?php 2 2 3 if ( is_multisite() ) : 3 /** 4 * @group ms-required 5 * @group multisite 6 */ 7 class Tests_Multisite_wpmuLogNewRegistrations extends WP_UnitTestCase { 4 8 5 /** 6 * @group multisite 7 */ 8 class Tests_Multisite_wpmuLogNewRegistrations extends WP_UnitTestCase { 9 public function test_wpmu_log_new_registrations() { 10 global $wpdb; 9 11 10 public function test_wpmu_log_new_registrations() {11 global $wpdb;12 $user = new WP_User( 1 ); 13 $ip = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] ); 12 14 13 $user = new WP_User( 1 ); 14 $ip = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] ); 15 wpmu_log_new_registrations( 1, 1 ); 15 16 16 wpmu_log_new_registrations( 1, 1 ); 17 18 // Currently there is no wrapper function for the registration_log. 19 $reg_blog = $wpdb->get_col( $wpdb->prepare( "SELECT email FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.blog_id = 1 AND IP LIKE %s", $ip ) ); 20 $this->assertSame( $user->user_email, $reg_blog[ count( $reg_blog ) - 1 ] ); 21 } 17 // Currently there is no wrapper function for the registration_log. 18 $reg_blog = $wpdb->get_col( $wpdb->prepare( "SELECT email FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.blog_id = 1 AND IP LIKE %s", $ip ) ); 19 $this->assertSame( $user->user_email, $reg_blog[ count( $reg_blog ) - 1 ] ); 22 20 } 23 24 endif; 21 }
Note: See TracChangeset
for help on using the changeset viewer.