Skip to content

Commit

Permalink
adjust scenario wording
Browse files Browse the repository at this point in the history
  • Loading branch information
zuk3975 committed Nov 20, 2020
1 parent cee043f commit cfd4504
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,6 @@ public function __construct()
$this->productImageRepository = $this->getContainer()->get('prestashop.adapter.product.repository.product_image_repository');
}

/**
* @When I add new product :productReference image :imageReference named :fileName
*
* @param string $productReference
* @param string $imageReference
* @param string $fileName
*/
public function uploadImage(string $productReference, string $imageReference, string $fileName): void
{
$pathName = DummyFileUploader::upload($fileName);

$imageId = $this->getCommandBus()->handle(new AddProductImageCommand(
$this->getSharedStorage()->get($productReference),
$pathName
));

$this->getSharedStorage()->set($imageReference, $imageId->getValue());
}

/**
* @Given following image types should be applicable to products:
*/
Expand All @@ -93,6 +74,25 @@ public function assertProductsImageTypesExists(TableNode $tableNode)
}
}

/**
* @When I add new image :imageReference named :fileName to product :productReference
*
* @param string $imageReference
* @param string $fileName
* @param string $productReference
*/
public function uploadImage(string $imageReference, string $fileName, string $productReference): void
{
$pathName = DummyFileUploader::upload($fileName);

$imageId = $this->getCommandBus()->handle(new AddProductImageCommand(
$this->getSharedStorage()->get($productReference),
$pathName
));

$this->getSharedStorage()->set($imageReference, $imageId->getValue());
}

/**
* @Given images :imageReferences should have following types generated:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Feature: Add product image from Back Office (BO)
| is_virtual | false |
And product "product1" type should be standard
And product "product1" should have no images
When I add new product "product1" image "image1" named "app_icon.png"
When I add new image "image1" named "app_icon.png" to product "product1"
Then product "product1" should have following images:
| image reference | is cover | legend | position |
| image1 | true | en-US: | 1 |
When I add new product "product1" image "image2" named "logo.jpg"
When I add new image "image2" named "logo.jpg" to product "product1"
Then product "product1" should have following images:
| image reference | is cover | legend | position |
| image1 | true | en-US: | 1 |
Expand Down

0 comments on commit cfd4504

Please sign in to comment.