function it_deletes_a_product(AdminProductShowPageInterface $adminProductShowPage, SharedStorageInterface $sharedStorage, ProductInterface $product) { $sharedStorage->set('product', $product)->shouldBeCalled(); $product->getName()->willReturn('Model'); $product->getId()->willReturn(1); $adminProductShowPage->open(['id' => 1])->shouldBeCalled(); $adminProductShowPage->deleteProduct()->shouldBeCalled(); $this->iDeleteProduct($product); }
/** * @When I delete the :product product */ public function iDeleteProduct(ProductInterface $product) { $this->adminProductShowPage->open(['id' => $product->getId()]); $this->adminProductShowPage->deleteProduct(); $this->sharedStorage->set('product', $product); }