From acbb448f6b2d706766cb9cc251ee5f6c6d2b71aa Mon Sep 17 00:00:00 2001 From: anitaamurthy Date: Tue, 8 Mar 2022 13:55:11 +0530 Subject: [PATCH] Updated existing unit tests --- .../rest-api/Tests/Version3/product-reviews.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-reviews.php b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-reviews.php index 9a69f06a863..c277b0e2d7d 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-reviews.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/rest-api/Tests/Version3/product-reviews.php @@ -56,6 +56,8 @@ class WC_Tests_API_Product_Reviews extends WC_REST_Unit_Test_Case { 'date_created' => $product_reviews[0]['date_created'], 'date_created_gmt' => $product_reviews[0]['date_created_gmt'], 'product_id' => $product->get_id(), + 'product_name' => $product->get_name(), + 'product_permalink' => $product->get_permalink(), 'status' => 'approved', 'reviewer' => 'admin', 'reviewer_email' => 'woo@woo.local', @@ -128,6 +130,8 @@ class WC_Tests_API_Product_Reviews extends WC_REST_Unit_Test_Case { 'date_created' => $data['date_created'], 'date_created_gmt' => $data['date_created_gmt'], 'product_id' => $product->get_id(), + 'product_name' => $product->get_name(), + 'product_permalink' => $product->get_permalink(), 'status' => 'approved', 'reviewer' => 'admin', 'reviewer_email' => 'woo@woo.local', @@ -193,6 +197,8 @@ class WC_Tests_API_Product_Reviews extends WC_REST_Unit_Test_Case { 'date_created' => $data['date_created'], 'date_created_gmt' => $data['date_created_gmt'], 'product_id' => $product->get_id(), + 'product_name' => $product->get_name(), + 'product_permalink' => $product->get_permalink(), 'status' => 'approved', 'reviewer' => 'Admin', 'reviewer_email' => 'woo@woo.local', @@ -451,11 +457,13 @@ class WC_Tests_API_Product_Reviews extends WC_REST_Unit_Test_Case { $data = $response->get_data(); $properties = $data['schema']['properties']; - $this->assertEquals( 11, count( $properties ) ); + $this->assertEquals( 13, count( $properties ) ); $this->assertArrayHasKey( 'id', $properties ); $this->assertArrayHasKey( 'date_created', $properties ); $this->assertArrayHasKey( 'date_created_gmt', $properties ); $this->assertArrayHasKey( 'product_id', $properties ); + $this->assertArrayHasKey( 'product_name', $properties ); + $this->assertArrayHasKey( 'product_permalink', $properties ); $this->assertArrayHasKey( 'status', $properties ); $this->assertArrayHasKey( 'reviewer', $properties ); $this->assertArrayHasKey( 'reviewer_email', $properties );