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 43a1919..d9bda61 100644 --- a/tests/customer/woocommerce/test-wc-retailcrm-customer-switcher-state.php +++ b/tests/customer/woocommerce/test-wc-retailcrm-customer-switcher-state.php @@ -46,14 +46,14 @@ class WC_Retailcrm_Customer_Switcher_State_Test extends WC_Retailcrm_Test_Case_H public function test_validate_empty() { - $this->expectException(InvalidArgumentException::class); + $this->expectException('\InvalidArgumentException'); $state = new WC_Retailcrm_Customer_Switcher_State(); $state->validate(); } public function test_validate_order() { - $this->expectException(InvalidArgumentException::class); + $this->expectException('\InvalidArgumentException'); $state = new WC_Retailcrm_Customer_Switcher_State(); $state->setWcOrder(new WC_Order()) ->validate(); @@ -61,7 +61,7 @@ class WC_Retailcrm_Customer_Switcher_State_Test extends WC_Retailcrm_Test_Case_H public function test_validate_customer_and_contact_set() { - $this->expectException(InvalidArgumentException::class); + $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 b2a9d74..4aa2181 100644 --- a/tests/customer/woocommerce/test-wc-retailcrm-wc-customer-builder.php +++ b/tests/customer/woocommerce/test-wc-retailcrm-wc-customer-builder.php @@ -13,21 +13,21 @@ class WC_Retailcrm_WC_Customer_Builder_Test extends WC_Retailcrm_Test_Case_Helpe { public function test_empty() { - $this->expectException(RuntimeException::class); + $this->expectException('\RuntimeException'); $builder = new WC_Retailcrm_WC_Customer_Builder(); $builder->build(); } public function test_empty_array() { - $this->expectException(RuntimeException::class); + $this->expectException('\RuntimeException'); $builder = new WC_Retailcrm_WC_Customer_Builder(); $builder->setData(array())->build(); } public function test_not_array() { - $this->expectException(RuntimeException::class); + $this->expectException('\RuntimeException'); $builder = new WC_Retailcrm_WC_Customer_Builder(); $builder->setData(new stdClass())->build(); } @@ -42,7 +42,7 @@ class WC_Retailcrm_WC_Customer_Builder_Test extends WC_Retailcrm_Test_Case_Helpe $builder = new WC_Retailcrm_WC_Customer_Builder(); $wcCustomer = $builder->setData($customerData)->build()->getResult(); - $this->assertInstanceOf(WC_Customer::class, $wcCustomer); + $this->assertInstanceOf('\WC_Customer', $wcCustomer); if (isset($customerData['firstName'])) { $this->assertEquals($customerData['firstName'], $wcCustomer->get_first_name()); diff --git a/tests/models/test-wc-retailcrm-customer-switcher-result.php b/tests/models/test-wc-retailcrm-customer-switcher-result.php index eb446b6..0eb0e7e 100644 --- a/tests/models/test-wc-retailcrm-customer-switcher-result.php +++ b/tests/models/test-wc-retailcrm-customer-switcher-result.php @@ -13,33 +13,33 @@ class WC_Retailcrm_Customer_Switcher_Result_Test extends WC_Retailcrm_Test_Case_ { public function test_invalid_both() { - $this->expectException(InvalidArgumentException::class); + $this->expectException('\InvalidArgumentException'); new WC_Retailcrm_Customer_Switcher_Result(new stdClass(), new stdClass()); } public function test_invalid_customer() { - $this->expectException(InvalidArgumentException::class); + $this->expectException('\InvalidArgumentException'); new WC_Retailcrm_Customer_Switcher_Result(new stdClass(), new WC_Order()); } public function test_invalid_order() { - $this->expectException(InvalidArgumentException::class); + $this->expectException('\InvalidArgumentException'); new WC_Retailcrm_Customer_Switcher_Result(new WC_Customer(), new stdClass()); } public function test_valid() { $result = new WC_Retailcrm_Customer_Switcher_Result(new WC_Customer(), new WC_Order()); - $this->assertInstanceOf(WC_Customer::class, $result->getWcCustomer()); - $this->assertInstanceOf(WC_Order::class, $result->getWcOrder()); + $this->assertInstanceOf('\WC_Customer', $result->getWcCustomer()); + $this->assertInstanceOf('\WC_Order', $result->getWcOrder()); } public function test_valid_no_customer() { $result = new WC_Retailcrm_Customer_Switcher_Result(null, new WC_Order()); $this->assertEmpty($result->getWcCustomer()) -; $this->assertInstanceOf(WC_Order::class, $result->getWcOrder()); +; $this->assertInstanceOf('\WC_Order', $result->getWcOrder()); } } diff --git a/tests/test-wc-retailcrm-history.php b/tests/test-wc-retailcrm-history.php index d46176a..277701f 100644 --- a/tests/test-wc-retailcrm-history.php +++ b/tests/test-wc-retailcrm-history.php @@ -619,7 +619,7 @@ class WC_Retailcrm_History_Test extends WC_Retailcrm_Test_Case_Helper private function regenerateMocks() { - $this->apiMock = $this->getMockBuilder(WC_Retailcrm_Proxy::class) + $this->apiMock = $this->getMockBuilder('\WC_Retailcrm_Proxy') ->disableOriginalConstructor() ->setMethods(array( 'ordersHistory', diff --git a/tests/test-wc-retailcrm-plugin.php b/tests/test-wc-retailcrm-plugin.php index 9c6fd04..07ddf1e 100644 --- a/tests/test-wc-retailcrm-plugin.php +++ b/tests/test-wc-retailcrm-plugin.php @@ -70,23 +70,24 @@ class WC_Retailcrm_Plugin_Test extends WC_Retailcrm_Test_Case_Helper public function dataProviderIntegrationModule() { $this->setUp(); + $responseData = $this->getResponseData(); return array( array( - 'retailcrm' => $this->getApiMock($this->getResponseData()['true']), - 'response' => $this->getResponseData()['true'] + 'retailcrm' => $this->getApiMock($responseData['true']), + 'response' => $responseData['true'] ), array( 'retailcrm' => false, - 'response' => $this->getResponseData()['true'] + 'response' => $responseData['true'] ), array( - 'retailcrm' => $this->getApiMock($this->getResponseData()['false']), - 'response' => $this->getResponseData()['false'] + 'retailcrm' => $this->getApiMock($responseData['false']), + 'response' => $responseData['false'] ), array( 'retailcrm' => false, - 'response' => $this->getResponseData()['false'] + 'response' => $responseData['false'] ) ); }