-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for Notification Resolver
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
tests/Unit/Resolver/Notification/NotificationResolverTest.php
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 |
---|---|---|
@@ -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()); | ||
} | ||
} |