diff --git a/tests/framework/class-wc-unit-test-case.php b/tests/framework/class-wc-unit-test-case.php index 0f9d970bbc2..56a6ae076ed 100644 --- a/tests/framework/class-wc-unit-test-case.php +++ b/tests/framework/class-wc-unit-test-case.php @@ -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 *