From 3768110faa771321d9c38df7f1040d958bbf3347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB?= Date: Mon, 8 Jun 2020 10:51:05 +0300 Subject: [PATCH] tests compatibility with old phpunit --- .../test-wc-retailcrm-customer-switcher-state.php | 12 +++++++++--- .../test-wc-retailcrm-wc-customer-builder.php | 12 +++++++++--- .../test-wc-retailcrm-customer-switcher-result.php | 12 +++++++++--- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/tests/customer/woocommerce/test-wc-retailcrm-customer-switcher-state.php b/tests/customer/woocommerce/test-wc-retailcrm-customer-switcher-state.php index d9bda61..d4fb5ba 100644 --- a/tests/customer/woocommerce/test-wc-retailcrm-customer-switcher-state.php +++ b/tests/customer/woocommerce/test-wc-retailcrm-customer-switcher-state.php @@ -44,24 +44,30 @@ class WC_Retailcrm_Customer_Switcher_State_Test extends WC_Retailcrm_Test_Case_H $this->assertFalse($state->feasible()); } + /** + * @expectedException \InvalidArgumentException + */ public function test_validate_empty() { - $this->expectException('\InvalidArgumentException'); $state = new WC_Retailcrm_Customer_Switcher_State(); $state->validate(); } + /** + * @expectedException \InvalidArgumentException + */ public function test_validate_order() { - $this->expectException('\InvalidArgumentException'); $state = new WC_Retailcrm_Customer_Switcher_State(); $state->setWcOrder(new WC_Order()) ->validate(); } + /** + * @expectedException \InvalidArgumentException + */ public function test_validate_customer_and_contact_set() { - $this->expectException('\InvalidArgumentException'); $state = new WC_Retailcrm_Customer_Switcher_State(); $state->setWcOrder(new WC_Order()) ->setNewCustomer(array('id' => 1)) diff --git a/tests/customer/woocommerce/test-wc-retailcrm-wc-customer-builder.php b/tests/customer/woocommerce/test-wc-retailcrm-wc-customer-builder.php index 4aa2181..55bc258 100644 --- a/tests/customer/woocommerce/test-wc-retailcrm-wc-customer-builder.php +++ b/tests/customer/woocommerce/test-wc-retailcrm-wc-customer-builder.php @@ -11,23 +11,29 @@ class WC_Retailcrm_WC_Customer_Builder_Test extends WC_Retailcrm_Test_Case_Helper { + /** + * @expectedException \RuntimeException + */ public function test_empty() { - $this->expectException('\RuntimeException'); $builder = new WC_Retailcrm_WC_Customer_Builder(); $builder->build(); } + /** + * @expectedException \RuntimeException + */ public function test_empty_array() { - $this->expectException('\RuntimeException'); $builder = new WC_Retailcrm_WC_Customer_Builder(); $builder->setData(array())->build(); } + /** + * @expectedException \RuntimeException + */ public function test_not_array() { - $this->expectException('\RuntimeException'); $builder = new WC_Retailcrm_WC_Customer_Builder(); $builder->setData(new stdClass())->build(); } diff --git a/tests/models/test-wc-retailcrm-customer-switcher-result.php b/tests/models/test-wc-retailcrm-customer-switcher-result.php index 0eb0e7e..5ded62d 100644 --- a/tests/models/test-wc-retailcrm-customer-switcher-result.php +++ b/tests/models/test-wc-retailcrm-customer-switcher-result.php @@ -11,21 +11,27 @@ class WC_Retailcrm_Customer_Switcher_Result_Test extends WC_Retailcrm_Test_Case_Helper { + /** + * @expectedException \InvalidArgumentException + */ public function test_invalid_both() { - $this->expectException('\InvalidArgumentException'); new WC_Retailcrm_Customer_Switcher_Result(new stdClass(), new stdClass()); } + /** + * @expectedException \InvalidArgumentException + */ public function test_invalid_customer() { - $this->expectException('\InvalidArgumentException'); new WC_Retailcrm_Customer_Switcher_Result(new stdClass(), new WC_Order()); } + /** + * @expectedException \InvalidArgumentException + */ public function test_invalid_order() { - $this->expectException('\InvalidArgumentException'); new WC_Retailcrm_Customer_Switcher_Result(new WC_Customer(), new stdClass()); }