diff --git a/features/removing_guest_wishlists.feature b/features/removing_guest_wishlists.feature index 148ee247..9a14924f 100644 --- a/features/removing_guest_wishlists.feature +++ b/features/removing_guest_wishlists.feature @@ -22,11 +22,12 @@ Feature: Removing guest wishlists @cli Scenario: Removing guest wishlists with date - Given there is a guest wishlist which has been inactive for a week - And there are 2 wishlists in the database + Given there is a guest wishlist which has been inactive for 5 days + And there is a guest wishlist which has been inactive for 4 days + And there are 3 wishlists in the database When I run delete guests wishlists command to delete wishlists inactive for more than 5 days Then the command should succeed - And there is 1 wishlist in the database + And there are 2 wishlists in the database @cli Scenario: Removing guest wishlists with invalid date diff --git a/tests/Behat/Context/Setup/WishlistContext.php b/tests/Behat/Context/Setup/WishlistContext.php index ebd2c817..db53d151 100644 --- a/tests/Behat/Context/Setup/WishlistContext.php +++ b/tests/Behat/Context/Setup/WishlistContext.php @@ -159,15 +159,15 @@ public function userHasAWishlist(string $email): void } /** - * @When there is a guest wishlist which has been inactive for a week + * @When there is a guest wishlist which has been inactive for :days days */ - public function thereIsAGuestWishlistInactiveForAWeek(): void + public function thereIsAGuestWishlistInactiveForDays(int $days): void { $wishlist = new Wishlist(); $channel = $this->channelRepository->findOneByCode('WEB-US'); $updatedAt = new \DateTime(); - $updatedAt->modify('-7 days'); + $updatedAt->modify(\sprintf('-%d days', $days)); $wishlist->setChannel($channel); $wishlist->setUpdatedAt($updatedAt);