Skip to content

Commit

Permalink
Fix failing tests in PHP 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrice committed Sep 5, 2014
1 parent f70c00e commit ac5076a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/framework/class-wc-unit-test-case.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,24 @@ public function assertNotWPError( $actual, $message = '' ) {
$this->assertNotInstanceOf( 'WP_Error', $actual, $message );
}

/**
* Backport assertNotFalse to PHPUnit 3.6.12 which only runs in PHP 5.2
*
* @since 2.2
* @param $condition
* @param string $message
* @return mixed
*/
public static function assertNotFalse( $condition, $message = '' ) {

if ( version_compare( phpversion(), '5.2', '<' ) ) {

self::assertThat( $condition, self::logicalNot( self::isFalse() ), $message );

} else {

parent::assertNotFalse( $condition, $message );
}
}

}

0 comments on commit ac5076a

Please sign in to comment.