From e5d418305d82f740f03dae744b784916c95aa420 Mon Sep 17 00:00:00 2001 From: Barry Kooij Date: Fri, 24 Oct 2014 21:26:26 +0200 Subject: [PATCH] Unit Tests: Added assertIsWPError to WC unit test framework --- tests/framework/class-wc-unit-test-case.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 *