From 591a96743ebd787561caaf675178e653a8aa14a5 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 12 Sep 2013 04:01:34 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/db.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index 83770d5fde..1d771174a8 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -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 ) ); } /**