GET Order V3 API: Add test for image & virtual fields
This commit is contained in:
parent
d131ce1819
commit
6e8d023c95
|
@ -649,6 +649,8 @@ class WC_Tests_API_Orders extends WC_REST_Unit_Test_Case {
|
||||||
'sku' => null,
|
'sku' => null,
|
||||||
'price' => 4,
|
'price' => 4,
|
||||||
'parent_name' => null,
|
'parent_name' => null,
|
||||||
|
'virtual' => false,
|
||||||
|
'image' => null,
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals( 200, $response->get_status() );
|
$this->assertEquals( 200, $response->get_status() );
|
||||||
|
@ -1147,10 +1149,12 @@ class WC_Tests_API_Orders extends WC_REST_Unit_Test_Case {
|
||||||
$data = $response->get_data();
|
$data = $response->get_data();
|
||||||
|
|
||||||
$line_item_properties = $data['schema']['properties']['line_items']['items']['properties'];
|
$line_item_properties = $data['schema']['properties']['line_items']['items']['properties'];
|
||||||
$this->assertEquals( 15, count( $line_item_properties ) );
|
$this->assertEquals( 17, count( $line_item_properties ) );
|
||||||
$this->assertArrayHasKey( 'id', $line_item_properties );
|
$this->assertArrayHasKey( 'id', $line_item_properties );
|
||||||
$this->assertArrayHasKey( 'meta_data', $line_item_properties );
|
$this->assertArrayHasKey( 'meta_data', $line_item_properties );
|
||||||
$this->assertArrayHasKey( 'parent_name', $line_item_properties );
|
$this->assertArrayHasKey( 'parent_name', $line_item_properties );
|
||||||
|
$this->assertArrayHasKey( 'image', $line_item_properties );
|
||||||
|
$this->assertArrayHasKey( 'virtual', $line_item_properties );
|
||||||
|
|
||||||
$meta_data_item_properties = $line_item_properties['meta_data']['items']['properties'];
|
$meta_data_item_properties = $line_item_properties['meta_data']['items']['properties'];
|
||||||
$this->assertEquals( 5, count( $meta_data_item_properties ) );
|
$this->assertEquals( 5, count( $meta_data_item_properties ) );
|
||||||
|
|
Loading…
Reference in New Issue