From ae8cc5daa5757f87873172c4d0cad0d5ffde83c2 Mon Sep 17 00:00:00 2001 From: Carter Buce Date: Mon, 10 Feb 2025 17:41:18 -0800 Subject: [PATCH] Ramp up - Add tests for Products Delete API (#2865) Summary: ### Changes proposed in this Pull Request: - Adding simple Request and Response tests to the Products Delete API to increase code coverage and as a ramp-up work item for getting used to the dev flow in this repository - [x] Do the changed files pass `phpcs` checks? Please remove `phpcs:ignore` comments in changed files and fix any issues, or delete if not practical. Pull Request resolved: https://github.com/facebook/facebook-for-woocommerce/pull/2865 Test Plan: - `phpunit tests/Unit/Api/ProductCatalog/Products/Delete` Reviewed By: jczhuoMeta, vinkmeta Differential Revision: D68915742 Pulled By: carterbuce fbshipit-source-id: d7fb475ccc1f0c24632e8579d56feb5cb4bc54d2 --- .../Products/Delete/RequestTest.php | 26 +++++++++++++++++++ .../Products/Delete/ResponseTest.php | 25 ++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 tests/Unit/Api/ProductCatalog/Products/Delete/RequestTest.php create mode 100644 tests/Unit/Api/ProductCatalog/Products/Delete/ResponseTest.php diff --git a/tests/Unit/Api/ProductCatalog/Products/Delete/RequestTest.php b/tests/Unit/Api/ProductCatalog/Products/Delete/RequestTest.php new file mode 100644 index 000000000..183ca8147 --- /dev/null +++ b/tests/Unit/Api/ProductCatalog/Products/Delete/RequestTest.php @@ -0,0 +1,26 @@ +assertEquals( 'DELETE', $request->get_method() ); + $this->assertEquals( '/facebook-product-group-id', $request->get_path() ); + } +} diff --git a/tests/Unit/Api/ProductCatalog/Products/Delete/ResponseTest.php b/tests/Unit/Api/ProductCatalog/Products/Delete/ResponseTest.php new file mode 100644 index 000000000..f26c41c92 --- /dev/null +++ b/tests/Unit/Api/ProductCatalog/Products/Delete/ResponseTest.php @@ -0,0 +1,25 @@ +assertTrue( $response->success ); + } +}