@@ -25,6 +25,17 @@ public function testCanGetProductVariant(): void
2525 $ variantResponse = $ this ->getApi ()->catalog ()->product ($ productId )->variant ($ variantId )->get ();
2626 $ this ->assertEquals ($ productId , $ variantResponse ->getProductVariant ()->product_id );
2727 $ this ->assertEquals ($ variantId , $ variantResponse ->getProductVariant ()->id );
28+
29+ $ this ->assertEquals ("catalog/products/ $ productId/variants/ $ variantId " , $ this ->getLastRequestPath ());
30+ $ this ->assertEquals ('GET ' , $ this ->getLastRequest ()->getMethod ());
31+
32+ $ methods = array_map (function ($ r ) {
33+ return $ r ['request ' ]->getMethod ();
34+ }, $ this ->getRequestHistory ());
35+
36+ $ this ->assertNotContains ('DELETE ' , $ methods );
37+ $ this ->assertNotContains ('PUT ' , $ methods );
38+ $ this ->assertNotContains ('POST ' , $ methods );
2839 }
2940
3041 public function testCanGetAllProductVariants (): void
@@ -36,4 +47,17 @@ public function testCanGetAllProductVariants(): void
3647 $ this ->assertEquals (3 , $ variantsResponse ->getPagination ()->total );
3748 $ this ->assertCount (3 , $ variantsResponse ->getProductVariants ());
3849 }
50+
51+ public function testCanDeleteProductVariant (): void
52+ {
53+ $ this ->setReturnData (self ::EMPTY_RESPONSE , 204 );
54+
55+ $ productId = 192 ;
56+ $ variantId = 384 ;
57+
58+ $ this ->getApi ()->catalog ()->product ($ productId )->variant ($ variantId )->delete ();
59+
60+ $ this ->assertEquals ("catalog/products/ $ productId/variants/ $ variantId " , $ this ->getLastRequestPath ());
61+ $ this ->assertEquals ('DELETE ' , $ this ->getLastRequest ()->getMethod ());
62+ }
3963}
0 commit comments