GET Order V3 API: Add test for image & virtual fields

This commit is contained in:
Anitaa 2021-04-06 10:14:05 +05:30
parent d131ce1819
commit 6e8d023c95
1 changed files with 5 additions and 1 deletions

View File

@ -649,6 +649,8 @@ class WC_Tests_API_Orders extends WC_REST_Unit_Test_Case {
'sku' => null,
'price' => 4,
'parent_name' => null,
'virtual' => false,
'image' => null,
);
$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();
$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( 'meta_data', $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'];
$this->assertEquals( 5, count( $meta_data_item_properties ) );