Skip to content

Commit

Permalink
Assert to import product associations (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
lruozzi9 committed Aug 29, 2022
1 parent e13e27a commit 9837d81
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion features/importing_product_associations_from_queue.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Feature: Importing product associations from queue
And the store has a product "10627329"
And the store has a product "upsell-product-1" with code "upsell-product-1"
And the store has a product "upsell-product-2" with code "upsell-product-2"
And there is one product associations to import with identifier "10627329" in the Akeneo queue
And the store has a product association type "Upsell" with a code "UPSELL"
And there is a product "10627329" on Akeneo
When I import all from Akeneo
Then the product "10627329" should be associated to product "upsell-product-1" for association with code "UPSELL"
And the product "10627329" should be associated to product "upsell-product-2" for association with code "UPSELL"
1 change: 1 addition & 0 deletions tests/Behat/Context/Cli/ImportCommandContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public function iImportItemsForAllImportersModifiedSinceDateSpecifiedFromFile(st

/**
* @When I import all items for all importers
* @When I import all from Akeneo
*/
public function iImportAllItemsForAllImporters(): void
{
Expand Down
5 changes: 3 additions & 2 deletions tests/Behat/Context/Setup/AkeneoContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ public function __construct(
}

/**
* @Given there is a product :identifier on Akeneo
* @Given there is a product :identifier updated at :date on Akeneo
*/
public function thereIsAProductUpdatedAtOnAkeneo(string $identifier, DateTime $date): void
public function thereIsAProductUpdatedAtOnAkeneo(string $identifier, DateTime $date = null): void
{
Assert::isInstanceOf($this->apiClient, ApiClientMock::class);
$this->apiClient->addProductUpdatedAt($identifier, $date);
$this->apiClient->addProductUpdatedAt($identifier, $date ?? new DateTime());
}

/**
Expand Down
4 changes: 3 additions & 1 deletion tests/Behat/Resources/suites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ default:
- sylius.behat.context.setup.product_association
- sylius.behat.context.setup.channel
- webgriffe_sylius_akeneo.behat.context.setup.queue
- webgriffe_sylius_akeneo.behat.context.setup.akeneo

- webgriffe_sylius_akeneo.behat.context.db.product
- webgriffe_sylius_akeneo.behat.context.messenger

- webgriffe_sylius_akeneo.behat.context.cli.import_command

filters:
tags: "@importing_product_associations && @cli"
Expand Down

0 comments on commit 9837d81

Please sign in to comment.