Skip to content

Commit

Permalink
Fixes after PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
GSadee committed Apr 4, 2019
1 parent 8fa9955 commit 766d361
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
3 changes: 3 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* The views have been moved to the appropriate directories depending on the context.
* This might require changing the serializer settings in your application
* Tactician has been replaced with Symfony Messenger.
* Used `League\Tactician\CommandBus` has been replaced with `Symfony\Component\Messenger\MessageBusInterface`
* The commands are now dispatched using `dispatch()` method instead of `handle()`
* The method name in handlers has been changed from `handle()` to `__invoke()`

# UPGRADE FROM 1.0.0-beta.17 to 1.0.0-beta.18

Expand Down
19 changes: 0 additions & 19 deletions spec/EventListener/UserRegistrationListenerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@

use Doctrine\Common\Persistence\ObjectManager;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Sylius\Component\Channel\Repository\ChannelRepositoryInterface;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\ShopUserInterface;
use Sylius\Component\User\Repository\UserRepositoryInterface;
use Sylius\ShopApiPlugin\Command\Cart\PickupCart;
use Sylius\ShopApiPlugin\Command\Customer\GenerateVerificationToken;
use Sylius\ShopApiPlugin\Command\Customer\SendVerificationToken;
use Sylius\ShopApiPlugin\Event\CustomerRegistered;
Expand Down Expand Up @@ -41,26 +39,9 @@ function it_generates_and_sends_verification_token_if_channel_requires_verificat
$firstCommand = new GenerateVerificationToken('shop@example.com');
$bus->dispatch($firstCommand)->willReturn(new Envelope($firstCommand))->shouldBeCalled();

$bus
->dispatch(Argument::that(function (PickupCart $pickupCart): bool {
return !empty($pickupCart->orderToken()) && $pickupCart->channelCode() === 'en_GB';
}))
->willReturn(new Envelope(new \stdClass()))
->shouldBeCalled()
;


$secondCommand = new SendVerificationToken('shop@example.com', 'WEB_GB');
$bus->dispatch($secondCommand)->willReturn(new Envelope($secondCommand))->shouldBeCalled();

$bus
->dispatch(Argument::that(function (PickupCart $pickupCart): bool {
return !empty($pickupCart->orderToken()) && $pickupCart->channelCode() === 'en_GB';
}))
->willReturn(new Envelope(new \stdClass()))
->shouldBeCalled()
;

$this->handleUserVerification(new CustomerRegistered(
'shop@example.com',
'Shop',
Expand Down
4 changes: 2 additions & 2 deletions spec/Normalizer/RequestCartTokenNormalizerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ function it_picks_up_new_cart_and_sets_its_token_on_request_if_token_was_not_pas
$validator->validate(Argument::type(PickupCartRequest::class))->willReturn($constraintViolationList);

$bus
->dispatch(Argument::that(function (PickupCart $pickupCart): bool {
return !empty($pickupCart->orderToken()) && $pickupCart->channelCode() === 'en_GB';
->dispatch(Argument::that(function (PickupCart $command): bool {
return !empty($command->orderToken()) && $command->channelCode() === 'en_GB';
}))
->willReturn(new Envelope(new \stdClass()))
->shouldBeCalled()
Expand Down

0 comments on commit 766d361

Please sign in to comment.