Changeset 59069
- Timestamp:
- 09/19/2024 06:55:00 PM (9 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wpdb.php
r57926 r59069 2115 2115 */ 2116 2116 public function check_connection( $allow_bail = true ) { 2117 if ( ! empty( $this->dbh ) && mysqli_ping( $this->dbh ) ) { 2117 // Check if the connection is alive. 2118 if ( ! empty( $this->dbh ) && mysqli_query( $this->dbh, 'DO 1' ) !== false ) { 2118 2119 return true; 2119 2120 } -
trunk/tests/phpunit/tests/db.php
r58164 r59069 2456 2456 $this->assertTrue( $wpdb->use_mysqli ); 2457 2457 } 2458 2459 /** 2460 * Verify "pinging" the database works cross-version PHP. 2461 * 2462 * @ticket 62061 2463 */ 2464 public function test_check_connection_returns_true_when_there_is_a_connection() { 2465 global $wpdb; 2466 2467 $this->assertTrue( $wpdb->check_connection( false ) ); 2468 } 2458 2469 }
Note: See TracChangeset
for help on using the changeset viewer.