Unit Tests: Added assertIsWPError to WC unit test framework

This commit is contained in:
Barry Kooij 2014-10-24 21:26:26 +02:00
parent 6960138876
commit e5d418305d
1 changed files with 10 additions and 0 deletions

View File

@ -71,6 +71,16 @@ class WC_Unit_Test_Case extends WP_UnitTestCase {
$this->assertNotInstanceOf( 'WP_Error', $actual, $message );
}
/**
* Asserts thing is WP_Error
*
* @param $actual
* @param string $message
*/
public function assertIsWPError( $actual, $message = '' ) {
$this->assertInstanceOf( 'WP_Error', $actual, $message );
}
/**
* Backport assertNotFalse to PHPUnit 3.6.12 which only runs in PHP 5.2
*