-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d8594e
commit e48d3ab
Showing
46 changed files
with
330 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by developers working at BitBag | ||
* Do you need more information about us and what we do? Visit our https://bitbag.io website! | ||
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career | ||
*/ | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by developers working at BitBag | ||
* Do you need more information about us and what we do? Visit our https://bitbag.io website! | ||
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career | ||
*/ | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\BitBag\SyliusWishlistPlugin\CommandHandler\Wishlist; | ||
|
||
use BitBag\SyliusWishlistPlugin\Command\Wishlist\AddProductToSelectedWishlist; | ||
use BitBag\SyliusWishlistPlugin\Command\Wishlist\AddProductToSelectedWishlistInterface; | ||
use BitBag\SyliusWishlistPlugin\CommandHandler\Wishlist\AddProductToSelectedWishlistHandler; | ||
use BitBag\SyliusWishlistPlugin\Entity\WishlistInterface; | ||
|
@@ -24,11 +24,11 @@ final class AddProductToSelectedWishlistHandlerSpec extends ObjectBehavior | |
{ | ||
public function let( | ||
WishlistProductFactoryInterface $wishlistProductFactory, | ||
WishlistRepositoryInterface $wishlistRepository | ||
WishlistRepositoryInterface $wishlistRepository, | ||
): void { | ||
$this->beConstructedWith( | ||
$wishlistProductFactory, | ||
$wishlistRepository | ||
$wishlistRepository, | ||
); | ||
} | ||
|
||
|
@@ -43,9 +43,8 @@ public function it_adds_product_to_wishlist_if_product_is_found( | |
WishlistInterface $wishlist, | ||
WishlistProductFactoryInterface $wishlistProductFactory, | ||
WishlistProductInterface $wishlistProduct, | ||
WishlistRepositoryInterface $wishlistRepository | ||
): void | ||
{ | ||
WishlistRepositoryInterface $wishlistRepository, | ||
): void { | ||
$addProductToSelectedWishlist->getProduct()->willReturn($product); | ||
$addProductToSelectedWishlist->getWishlist()->willReturn($wishlist); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by developers working at BitBag | ||
* Do you need more information about us and what we do? Visit our https://bitbag.io website! | ||
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career | ||
*/ | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\BitBag\SyliusWishlistPlugin\CommandHandler\Wishlist; | ||
|
||
use BitBag\SyliusWishlistPlugin\Command\Wishlist\AddProductToWishlist; | ||
use BitBag\SyliusWishlistPlugin\Command\Wishlist\WishlistTokenValueAwareInterface; | ||
use BitBag\SyliusWishlistPlugin\CommandHandler\Wishlist\AddProductToWishlistHandler; | ||
use BitBag\SyliusWishlistPlugin\Entity\WishlistInterface; | ||
use BitBag\SyliusWishlistPlugin\Entity\WishlistProductInterface; | ||
use BitBag\SyliusWishlistPlugin\Exception\ProductNotFoundException; | ||
use BitBag\SyliusWishlistPlugin\Exception\WishlistNotFoundException; | ||
use BitBag\SyliusWishlistPlugin\Factory\WishlistProductFactoryInterface; | ||
use Doctrine\Persistence\ObjectManager; | ||
use PhpSpec\ObjectBehavior; | ||
|
@@ -28,12 +27,12 @@ final class AddProductToWishlistHandlerSpec extends ObjectBehavior | |
public function let( | ||
WishlistProductFactoryInterface $wishlistProductFactory, | ||
ProductRepositoryInterface $productRepository, | ||
ObjectManager $wishlistManager | ||
ObjectManager $wishlistManager, | ||
): void { | ||
$this->beConstructedWith( | ||
$wishlistProductFactory, | ||
$productRepository, | ||
$wishlistManager | ||
$wishlistManager, | ||
); | ||
} | ||
|
||
|
@@ -48,9 +47,8 @@ public function it_adds_product_to_wishlist( | |
ProductRepositoryInterface $productRepository, | ||
WishlistProductFactoryInterface $wishlistProductFactory, | ||
WishlistProductInterface $wishlistProduct, | ||
ObjectManager $wishlistManager | ||
): void | ||
{ | ||
ObjectManager $wishlistManager, | ||
): void { | ||
$productRepository->find(1)->willReturn($product); | ||
|
||
$wishlistProductFactory->createForWishlistAndProduct($wishlist, $product)->willReturn($wishlistProduct); | ||
|
@@ -71,9 +69,8 @@ public function it_doesnt_add_product_to_wishlist_if_product_isnt_found( | |
ProductRepositoryInterface $productRepository, | ||
WishlistProductFactoryInterface $wishlistProductFactory, | ||
WishlistProductInterface $wishlistProduct, | ||
ObjectManager $wishlistManager | ||
): void | ||
{ | ||
ObjectManager $wishlistManager, | ||
): void { | ||
$productRepository->find(1)->willReturn(null); | ||
|
||
$wishlistProductFactory->createForWishlistAndProduct($wishlist, $product)->shouldNotBeCalled(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by developers working at BitBag | ||
* Do you need more information about us and what we do? Visit our https://bitbag.io website! | ||
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career | ||
*/ | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\BitBag\SyliusWishlistPlugin\CommandHandler\Wishlist; | ||
|
||
use BitBag\SyliusWishlistPlugin\Command\Wishlist\AddProductVariantToWishlist; | ||
use BitBag\SyliusWishlistPlugin\Command\Wishlist\WishlistTokenValueAwareInterface; | ||
use BitBag\SyliusWishlistPlugin\CommandHandler\Wishlist\AddProductVariantToWishlistHandler; | ||
use BitBag\SyliusWishlistPlugin\Entity\WishlistInterface; | ||
use BitBag\SyliusWishlistPlugin\Entity\WishlistProductInterface; | ||
|
@@ -27,12 +27,12 @@ final class AddProductVariantToWishlistHandlerSpec extends ObjectBehavior | |
public function let( | ||
WishlistProductFactoryInterface $wishlistProductFactory, | ||
ProductVariantRepositoryInterface $productVariantRepository, | ||
ObjectManager $wishlistManager | ||
ObjectManager $wishlistManager, | ||
): void { | ||
$this->beConstructedWith( | ||
$wishlistProductFactory, | ||
$productVariantRepository, | ||
$wishlistManager | ||
$wishlistManager, | ||
); | ||
} | ||
|
||
|
@@ -47,9 +47,8 @@ public function it_adds_product_variant_to_wishlist( | |
ProductVariantRepositoryInterface $productVariantRepository, | ||
WishlistProductFactoryInterface $wishlistProductFactory, | ||
WishlistProductInterface $wishlistProduct, | ||
ObjectManager $wishlistManager | ||
): void | ||
{ | ||
ObjectManager $wishlistManager, | ||
): void { | ||
$productVariantRepository->find(1)->willReturn($productVariant); | ||
|
||
$wishlistProductFactory->createForWishlistAndVariant($wishlist, $productVariant)->willReturn($wishlistProduct); | ||
|
@@ -70,9 +69,8 @@ public function it_doesnt_add_product_variant_to_wishlist_if_variant_isnt_found( | |
ProductVariantRepositoryInterface $productVariantRepository, | ||
WishlistProductFactoryInterface $wishlistProductFactory, | ||
WishlistProductInterface $wishlistProduct, | ||
ObjectManager $wishlistManager | ||
): void | ||
{ | ||
ObjectManager $wishlistManager, | ||
): void { | ||
$productVariantRepository->find(1)->willReturn(null); | ||
|
||
$wishlistProductFactory->createForWishlistAndVariant($wishlist, $productVariant)->shouldNotBeCalled(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by developers working at BitBag | ||
* Do you need more information about us and what we do? Visit our https://bitbag.io website! | ||
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career | ||
*/ | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
|
@@ -18,7 +19,6 @@ | |
use Sylius\Bundle\OrderBundle\Controller\AddToCartCommandInterface; | ||
use Sylius\Component\Core\Model\OrderInterface; | ||
use Sylius\Component\Core\Model\OrderItemInterface; | ||
use Sylius\Component\Core\Model\ProductInterface; | ||
use Sylius\Component\Core\Model\ProductVariantInterface; | ||
use Sylius\Component\Core\Repository\OrderRepositoryInterface; | ||
use Sylius\Component\Inventory\Checker\AvailabilityCheckerInterface; | ||
|
@@ -35,14 +35,14 @@ public function let( | |
TranslatorInterface $translator, | ||
OrderModifierInterface $orderModifier, | ||
OrderRepositoryInterface $orderRepository, | ||
AvailabilityCheckerInterface $availabilityChecker | ||
AvailabilityCheckerInterface $availabilityChecker, | ||
): void { | ||
$this->beConstructedWith( | ||
$requestStack, | ||
$translator, | ||
$orderModifier, | ||
$orderRepository, | ||
$availabilityChecker | ||
$availabilityChecker, | ||
); | ||
} | ||
|
||
|
@@ -51,7 +51,6 @@ public function it_is_initializable(): void | |
$this->shouldHaveType(AddProductsToCartHandler::class); | ||
} | ||
|
||
|
||
public function it_adds_products_from_wishlist_to_cart( | ||
AvailabilityCheckerInterface $availabilityChecker, | ||
ProductVariantInterface $productVariant, | ||
|
@@ -65,7 +64,7 @@ public function it_adds_products_from_wishlist_to_cart( | |
RequestStack $requestStack, | ||
Session $session, | ||
FlashBagInterface $flashBag, | ||
TranslatorInterface $translator | ||
TranslatorInterface $translator, | ||
): void { | ||
$collection = new ArrayCollection([$wishlistProduct->getWrappedObject()]); | ||
$addProductsToCart->getWishlistProducts()->willReturn($collection); | ||
|
@@ -104,7 +103,7 @@ public function it_doesnt_add_products_from_wishlist_to_cart_if_stock_is_insuffi | |
RequestStack $requestStack, | ||
Session $session, | ||
FlashBagInterface $flashBag, | ||
TranslatorInterface $translator | ||
TranslatorInterface $translator, | ||
): void { | ||
$collection = new ArrayCollection([$wishlistProduct->getWrappedObject()]); | ||
$addProductsToCart->getWishlistProducts()->willReturn($collection); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<?php | ||
|
||
/* | ||
* This file was created by developers working at BitBag | ||
* Do you need more information about us and what we do? Visit our https://bitbag.io website! | ||
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career | ||
*/ | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
|
@@ -31,13 +32,13 @@ public function let( | |
OrderItemQuantityModifierInterface $itemQuantityModifier, | ||
OrderModifierInterface $orderModifier, | ||
OrderRepositoryInterface $orderRepository, | ||
ProductProcessingCheckerInterface $productProcessingChecker | ||
ProductProcessingCheckerInterface $productProcessingChecker, | ||
): void { | ||
$this->beConstructedWith( | ||
$itemQuantityModifier, | ||
$orderModifier, | ||
$orderRepository, | ||
$productProcessingChecker | ||
$productProcessingChecker, | ||
); | ||
} | ||
|
||
|
@@ -54,7 +55,7 @@ public function it_adds_selected_products_to_cart( | |
OrderInterface $order, | ||
OrderItemInterface $orderItem, | ||
AddToCartCommandInterface $addToCartCommand, | ||
ProductProcessingCheckerInterface $productProcessingChecker | ||
ProductProcessingCheckerInterface $productProcessingChecker, | ||
): void { | ||
$collection = new ArrayCollection([$wishlistProduct->getWrappedObject()]); | ||
$productProcessingChecker->canBeProcessed($wishlistProduct)->willReturn(true); | ||
|
@@ -83,7 +84,7 @@ public function it_doesnt_add_selected_products_to_cart_if_product_cannot_be_pro | |
OrderInterface $order, | ||
OrderItemInterface $orderItem, | ||
AddToCartCommandInterface $addToCartCommand, | ||
ProductProcessingCheckerInterface $productProcessingChecker | ||
ProductProcessingCheckerInterface $productProcessingChecker, | ||
): void { | ||
$collection = new ArrayCollection([$wishlistProduct->getWrappedObject()]); | ||
|
||
|
Oops, something went wrong.