Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mandan2 committed Sep 11, 2023
1 parent 21edfe5 commit 439a379
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/Unit/Factory/SubscriptionDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Mollie\Subscription\Tests\Unit\Factory;
namespace Mollie\Tests\Unit\Factory;

use Mollie;
use Mollie\Adapter\Link;
Expand All @@ -17,6 +17,7 @@
use Mollie\Subscription\Provider\SubscriptionIntervalProvider;
use Mollie\Subscription\Repository\CombinationRepository;
use Mollie\Subscription\Repository\CurrencyRepository;
use Mollie\Subscription\Validator\SubscriptionProductValidator;
use Mollie\Utility\SecureKeyUtility;
use PHPUnit\Framework\TestCase;

Expand Down Expand Up @@ -58,6 +59,9 @@ public function testBuildSubscriptionData(string $customerId, float $totalAmount
]
);

$subscriptionProductValidator = $this->createMock(SubscriptionProductValidator::class);
$subscriptionProductValidator->method('validate')->willReturn(true);

$subscriptionDataFactory = new CreateSubscriptionDataFactory(
$customerRepositoryMock,
$subscriptionIntervalProviderMock,
Expand All @@ -66,7 +70,8 @@ public function testBuildSubscriptionData(string $customerId, float $totalAmount
new CombinationRepository(),
$paymentMethodRepositoryMock,
new Link(),
new Mollie()
new Mollie(),
$subscriptionProductValidator
);

$customerMock = $this->createMock('Customer');
Expand All @@ -77,6 +82,7 @@ public function testBuildSubscriptionData(string $customerId, float $totalAmount
$order->method('getCartProducts')->willReturn([
[
'id_product_attribute' => 1,
'total_price_tax_incl' => 19.99,
],
]);
$order->id = self::TEST_ORDER_ID;
Expand Down

0 comments on commit 439a379

Please sign in to comment.