Make WordPress Core

Changeset 25374


Ignore:
Timestamp:
09/12/2013 04:01:34 AM (11 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/db.php

    r25084 r25374  
    9999        $this->assertTrue( isset( $wpdb->dbh ) ); // Test __isset()
    100100        unset( $wpdb->dbh );
    101         $this->assertNull( $wpdb->dbh );
     101        $this->assertTrue( empty( $wpdb->dbh ) );
    102102        $wpdb->dbh = $dbh;
    103103        $this->assertNotEmpty( $wpdb->dbh );
     
    110110        global $wpdb;
    111111
    112         $this->assertNull( $wpdb->nonexistent_property );
     112        $this->assertTrue( empty( $wpdb->nonexistent_property ) );
    113113        $wpdb->nonexistent_property = true;
    114114        $this->assertTrue( $wpdb->nonexistent_property );
    115115        $this->assertTrue( isset( $wpdb->nonexistent_property ) );
    116116        unset( $wpdb->nonexistent_property );
    117         $this->assertNull( $wpdb->nonexistent_property );
     117        $this->assertTrue( empty( $wpdb->nonexistent_property ) );
    118118    }
    119119
Note: See TracChangeset for help on using the changeset viewer.