mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 05:04:31 +00:00
Passing non-existent object properties to WP_UnitTestCase::assertNull() produces notices, opt instead for WP_UnitTestCase::assertTrue( empty( $obj->prop ) ) in tests/db.php.
See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25374 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -98,7 +98,7 @@ class Tests_DB extends WP_UnitTestCase {
|
||||
$this->assertNotEmpty( $dbh );
|
||||
$this->assertTrue( isset( $wpdb->dbh ) ); // Test __isset()
|
||||
unset( $wpdb->dbh );
|
||||
$this->assertNull( $wpdb->dbh );
|
||||
$this->assertTrue( empty( $wpdb->dbh ) );
|
||||
$wpdb->dbh = $dbh;
|
||||
$this->assertNotEmpty( $wpdb->dbh );
|
||||
}
|
||||
@@ -109,12 +109,12 @@ class Tests_DB extends WP_UnitTestCase {
|
||||
function test_wpdb_nonexistent_properties() {
|
||||
global $wpdb;
|
||||
|
||||
$this->assertNull( $wpdb->nonexistent_property );
|
||||
$this->assertTrue( empty( $wpdb->nonexistent_property ) );
|
||||
$wpdb->nonexistent_property = true;
|
||||
$this->assertTrue( $wpdb->nonexistent_property );
|
||||
$this->assertTrue( isset( $wpdb->nonexistent_property ) );
|
||||
unset( $wpdb->nonexistent_property );
|
||||
$this->assertNull( $wpdb->nonexistent_property );
|
||||
$this->assertTrue( empty( $wpdb->nonexistent_property ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user