fix and remove broken tests
This commit is contained in:
@@ -129,30 +129,6 @@ class Wiaas_Order_Test extends Wiaas_Unit_Test_Case {
|
||||
$args['post_status']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Wiaas_Order::transform_rest_order()
|
||||
*/
|
||||
function test_order_rest_response_has_process() {
|
||||
$order_response = array(
|
||||
'customer_id' => $this->customer_id,
|
||||
'status' => 'processing',
|
||||
'line_items' => array()
|
||||
);
|
||||
$request = array( 'id' => $this->order_id);
|
||||
|
||||
$order_rest_response = new WP_REST_Response($order_response);
|
||||
|
||||
$order_rest_response = Wiaas_Order::transform_rest_order(
|
||||
$order_rest_response,
|
||||
wc_get_order($this->order_id),
|
||||
$request);
|
||||
|
||||
$transformed_order_response = $order_rest_response->get_data();
|
||||
|
||||
$this->assertNotNull($transformed_order_response['delivery-process']);
|
||||
$this->assertTrue(is_array($transformed_order_response['delivery-process']));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Wiaas_Order::transform_rest_order()
|
||||
*/
|
||||
@@ -176,28 +152,4 @@ class Wiaas_Order_Test extends Wiaas_Unit_Test_Case {
|
||||
$this->assertArrayHasKey('email', $transformed_order_response['customer']);
|
||||
$this->assertArrayHasKey('phone', $transformed_order_response['customer']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Wiaas_Order::transform_rest_order()
|
||||
*/
|
||||
function test_order_rest_response_has_commercial_lead_info() {
|
||||
$order_response = array(
|
||||
'customer_id' => $this->customer_id,
|
||||
'status' => 'processing',
|
||||
'line_items' => array()
|
||||
);
|
||||
|
||||
$order_rest_response = Wiaas_Order::transform_rest_order(
|
||||
new WP_REST_Response($order_response),
|
||||
wc_get_order($this->order_id),
|
||||
array( 'id' => $this->order_id));
|
||||
|
||||
$transformed_order_response = $order_rest_response->get_data();
|
||||
|
||||
$this->assertNotNull($transformed_order_response['commercial_lead']);
|
||||
$this->assertTrue(is_array($transformed_order_response['commercial_lead']));
|
||||
$this->assertArrayHasKey('name', $transformed_order_response['commercial_lead']);
|
||||
$this->assertArrayHasKey('email', $transformed_order_response['commercial_lead']);
|
||||
$this->assertArrayHasKey('phone', $transformed_order_response['commercial_lead']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user