Skip to content

Commit

Permalink
Add unit test for Notification Resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarbeito committed Sep 8, 2024
1 parent 29ed5c6 commit 8c7dda6
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/Unit/Resolver/Notification/NotificationResolverTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/*
* 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 Tests\BitBag\SyliusAdyenPlugin\Unit\Resolver\Notification;

use BitBag\SyliusAdyenPlugin\Exception\NotificationItemsEmptyException;
use BitBag\SyliusAdyenPlugin\Resolver\Notification\NotificationResolver;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Tests\BitBag\SyliusAdyenPlugin\Unit\Mock\RequestMother;

final class NotificationResolverTest extends TestCase
{
public function testUndefinedNotificationItemsRequestIsHandledProperly(): void
{
$resolver = new NotificationResolver(
$this->createMock(DenormalizerInterface::class),
$this->createMock(ValidatorInterface::class),
new NullLogger(),
);

$this->expectException(NotificationItemsEmptyException::class);

$resolver->resolve('dummy-payment-code', RequestMother::createDummy());
}
}

0 comments on commit 8c7dda6

Please sign in to comment.