From f66f9c0158d1789b0db095de8030638dbac2ea2b Mon Sep 17 00:00:00 2001 From: Krishan Koenig Date: Fri, 5 Jan 2024 11:10:48 +0100 Subject: [PATCH] fix tests --- src/Endpoints/BalanceEndpoint.php | 4 ++-- src/Endpoints/BalanceReportEndpoint.php | 18 ++++++++++-------- src/Endpoints/BalanceTransactionEndpoint.php | 4 ++-- src/Endpoints/ChargebackEndpoint.php | 2 +- src/Endpoints/ClientEndpoint.php | 2 +- src/Endpoints/CustomerEndpoint.php | 2 +- src/Endpoints/CustomerPaymentsEndpoint.php | 2 +- ...ointAbstract.php => EndpointCollection.php} | 2 +- src/Endpoints/InvoiceEndpoint.php | 2 +- src/Endpoints/MandateEndpoint.php | 2 +- src/Endpoints/MethodEndpoint.php | 2 +- src/Endpoints/OnboardingEndpoint.php | 2 +- src/Endpoints/OrderEndpoint.php | 2 +- src/Endpoints/OrderLineEndpoint.php | 2 +- src/Endpoints/OrderPaymentEndpoint.php | 2 +- src/Endpoints/OrderRefundEndpoint.php | 2 +- src/Endpoints/PaymentCaptureEndpoint.php | 2 +- src/Endpoints/PaymentChargebackEndpoint.php | 2 +- src/Endpoints/PaymentEndpoint.php | 2 +- src/Endpoints/PaymentLinkEndpoint.php | 2 +- src/Endpoints/PaymentRefundEndpoint.php | 2 +- src/Endpoints/PermissionEndpoint.php | 2 +- src/Endpoints/ProfileEndpoint.php | 2 +- src/Endpoints/ProfileMethodEndpoint.php | 2 +- src/Endpoints/RefundEndpoint.php | 2 +- src/Endpoints/SettlementCaptureEndpoint.php | 2 +- src/Endpoints/SettlementChargebackEndpoint.php | 2 +- src/Endpoints/SettlementPaymentEndpoint.php | 2 +- src/Endpoints/SettlementRefundEndpoint.php | 2 +- src/Endpoints/SettlementsEndpoint.php | 2 +- src/Endpoints/ShipmentEndpoint.php | 2 +- src/Endpoints/SubscriptionEndpoint.php | 2 +- src/Endpoints/TerminalEndpoint.php | 2 +- src/Resources/ResourceFactory.php | 10 +++++----- .../API/Endpoints/OrderLineEndpointTest.php | 5 ++++- 35 files changed, 53 insertions(+), 48 deletions(-) rename src/Endpoints/{CollectionEndpointAbstract.php => EndpointCollection.php} (98%) diff --git a/src/Endpoints/BalanceEndpoint.php b/src/Endpoints/BalanceEndpoint.php index b6047ae7..a322c70d 100644 --- a/src/Endpoints/BalanceEndpoint.php +++ b/src/Endpoints/BalanceEndpoint.php @@ -7,9 +7,9 @@ use Mollie\Api\Resources\BalanceCollection; use Mollie\Api\Resources\LazyCollection; -class BalanceEndpoint extends CollectionRestEndpoint +class BalanceEndpoint extends EndpointCollection { - const string RESOURCE_ID_PREFIX = 'bal_'; + const RESOURCE_ID_PREFIX = 'bal_'; protected string $resourcePath = "balances"; diff --git a/src/Endpoints/BalanceReportEndpoint.php b/src/Endpoints/BalanceReportEndpoint.php index c3465af8..51e8af82 100644 --- a/src/Endpoints/BalanceReportEndpoint.php +++ b/src/Endpoints/BalanceReportEndpoint.php @@ -15,7 +15,7 @@ class BalanceReportEndpoint extends RestEndpoint /** * @inheritDoc */ - protected function getResourceObject() + protected function getResourceObject(): BalanceReport { return new BalanceReport($this->client); } @@ -25,10 +25,11 @@ protected function getResourceObject() * * @param string $balanceId * @param array $parameters - * @return \Mollie\Api\Resources\BalanceReport|\Mollie\Api\Resources\BaseResource + * + * @return BalanceReport * @throws \Mollie\Api\Exceptions\ApiException */ - public function getForId(string $balanceId, array $parameters = []) + public function getForId(string $balanceId, array $parameters = []): BalanceReport { $this->parentId = $balanceId; @@ -45,10 +46,11 @@ public function getForId(string $balanceId, array $parameters = []) * This is the balance of your account’s primary currency, where all payments are settled to by default. * * @param array $parameters - * @return \Mollie\Api\Resources\BalanceReport|\Mollie\Api\Resources\BaseResource + * + * @return BalanceReport * @throws \Mollie\Api\Exceptions\ApiException */ - public function getForPrimary(array $parameters = []) + public function getForPrimary(array $parameters = []): BalanceReport { return $this->getForId("primary", $parameters); } @@ -57,12 +59,12 @@ public function getForPrimary(array $parameters = []) /** * Retrieve a balance report for the provided balance resource and parameters. * - * @param \Mollie\Api\Resources\Balance $balance + * @param Balance $balance * @param array $parameters - * @return \Mollie\Api\Resources\BalanceReport|\Mollie\Api\Resources\BaseResource + * @return BalanceReport * @throws \Mollie\Api\Exceptions\ApiException */ - public function getFor(Balance $balance, array $parameters = []) + public function getFor(Balance $balance, array $parameters = []): BalanceReport { return $this->getForId($balance->id, $parameters); } diff --git a/src/Endpoints/BalanceTransactionEndpoint.php b/src/Endpoints/BalanceTransactionEndpoint.php index 28b94c79..52a18ea1 100644 --- a/src/Endpoints/BalanceTransactionEndpoint.php +++ b/src/Endpoints/BalanceTransactionEndpoint.php @@ -9,9 +9,9 @@ use Mollie\Api\Resources\BalanceTransactionCollection; use Mollie\Api\Resources\LazyCollection; -class BalanceTransactionEndpoint extends CollectionRestEndpoint +class BalanceTransactionEndpoint extends EndpointCollection { - const string RESOURCE_ID_PREFIX = 'baltr_'; + const RESOURCE_ID_PREFIX = 'baltr_'; protected string $resourcePath = "balances_transactions"; diff --git a/src/Endpoints/ChargebackEndpoint.php b/src/Endpoints/ChargebackEndpoint.php index d3468880..31c0e375 100644 --- a/src/Endpoints/ChargebackEndpoint.php +++ b/src/Endpoints/ChargebackEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\ChargebackCollection; use Mollie\Api\Resources\LazyCollection; -class ChargebackEndpoint extends CollectionRestEndpoint +class ChargebackEndpoint extends EndpointCollection { protected string $resourcePath = "chargebacks"; diff --git a/src/Endpoints/ClientEndpoint.php b/src/Endpoints/ClientEndpoint.php index 38631fc4..66cfaf29 100644 --- a/src/Endpoints/ClientEndpoint.php +++ b/src/Endpoints/ClientEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\ClientCollection; use Mollie\Api\Resources\LazyCollection; -class ClientEndpoint extends CollectionRestEndpoint +class ClientEndpoint extends EndpointCollection { protected string $resourcePath = "clients"; diff --git a/src/Endpoints/CustomerEndpoint.php b/src/Endpoints/CustomerEndpoint.php index ed18d85e..2ee9d420 100644 --- a/src/Endpoints/CustomerEndpoint.php +++ b/src/Endpoints/CustomerEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\CustomerCollection; use Mollie\Api\Resources\LazyCollection; -class CustomerEndpoint extends CollectionRestEndpoint +class CustomerEndpoint extends EndpointCollection { protected string $resourcePath = "customers"; diff --git a/src/Endpoints/CustomerPaymentsEndpoint.php b/src/Endpoints/CustomerPaymentsEndpoint.php index d372af0e..0469beeb 100644 --- a/src/Endpoints/CustomerPaymentsEndpoint.php +++ b/src/Endpoints/CustomerPaymentsEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\Payment; use Mollie\Api\Resources\PaymentCollection; -class CustomerPaymentsEndpoint extends CollectionRestEndpoint +class CustomerPaymentsEndpoint extends EndpointCollection { protected string $resourcePath = "customers_payments"; diff --git a/src/Endpoints/CollectionEndpointAbstract.php b/src/Endpoints/EndpointCollection.php similarity index 98% rename from src/Endpoints/CollectionEndpointAbstract.php rename to src/Endpoints/EndpointCollection.php index 1a7c8439..105ac982 100644 --- a/src/Endpoints/CollectionEndpointAbstract.php +++ b/src/Endpoints/EndpointCollection.php @@ -8,7 +8,7 @@ use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\ResourceFactory; -abstract class CollectionRestEndpoint extends RestEndpoint +abstract class EndpointCollection extends RestEndpoint { /** * Get a collection of objects from the REST API. diff --git a/src/Endpoints/InvoiceEndpoint.php b/src/Endpoints/InvoiceEndpoint.php index 78d7049c..6cc8a0ea 100644 --- a/src/Endpoints/InvoiceEndpoint.php +++ b/src/Endpoints/InvoiceEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\InvoiceCollection; use Mollie\Api\Resources\LazyCollection; -class InvoiceEndpoint extends CollectionRestEndpoint +class InvoiceEndpoint extends EndpointCollection { protected string $resourcePath = "invoices"; diff --git a/src/Endpoints/MandateEndpoint.php b/src/Endpoints/MandateEndpoint.php index e717c91d..ee26a3f0 100644 --- a/src/Endpoints/MandateEndpoint.php +++ b/src/Endpoints/MandateEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\Mandate; use Mollie\Api\Resources\MandateCollection; -class MandateEndpoint extends CollectionRestEndpoint +class MandateEndpoint extends EndpointCollection { protected string $resourcePath = "customers_mandates"; diff --git a/src/Endpoints/MethodEndpoint.php b/src/Endpoints/MethodEndpoint.php index 5df5dda8..72643e63 100644 --- a/src/Endpoints/MethodEndpoint.php +++ b/src/Endpoints/MethodEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\MethodCollection; use Mollie\Api\Resources\ResourceFactory; -class MethodEndpoint extends CollectionRestEndpoint +class MethodEndpoint extends EndpointCollection { protected string $resourcePath = "methods"; diff --git a/src/Endpoints/OnboardingEndpoint.php b/src/Endpoints/OnboardingEndpoint.php index 26d6e394..639658df 100644 --- a/src/Endpoints/OnboardingEndpoint.php +++ b/src/Endpoints/OnboardingEndpoint.php @@ -45,7 +45,7 @@ public function get(): Onboarding */ public function submit(array $parameters = []): void { - return $this->create($parameters, []); + $this->create($parameters, []); } /** diff --git a/src/Endpoints/OrderEndpoint.php b/src/Endpoints/OrderEndpoint.php index 2308fc2e..d064edfd 100644 --- a/src/Endpoints/OrderEndpoint.php +++ b/src/Endpoints/OrderEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\Order; use Mollie\Api\Resources\OrderCollection; -class OrderEndpoint extends CollectionRestEndpoint +class OrderEndpoint extends EndpointCollection { protected string $resourcePath = "orders"; diff --git a/src/Endpoints/OrderLineEndpoint.php b/src/Endpoints/OrderLineEndpoint.php index 15977260..52ba3bad 100644 --- a/src/Endpoints/OrderLineEndpoint.php +++ b/src/Endpoints/OrderLineEndpoint.php @@ -8,7 +8,7 @@ use Mollie\Api\Resources\OrderLineCollection; use Mollie\Api\Resources\ResourceFactory; -class OrderLineEndpoint extends CollectionRestEndpoint +class OrderLineEndpoint extends EndpointCollection { protected string $resourcePath = "orders_lines"; diff --git a/src/Endpoints/OrderPaymentEndpoint.php b/src/Endpoints/OrderPaymentEndpoint.php index a1d558ab..d661b9d5 100644 --- a/src/Endpoints/OrderPaymentEndpoint.php +++ b/src/Endpoints/OrderPaymentEndpoint.php @@ -6,7 +6,7 @@ use Mollie\Api\Resources\Payment; use Mollie\Api\Resources\PaymentCollection; -class OrderPaymentEndpoint extends CollectionRestEndpoint +class OrderPaymentEndpoint extends EndpointCollection { protected string $resourcePath = "orders_payments"; diff --git a/src/Endpoints/OrderRefundEndpoint.php b/src/Endpoints/OrderRefundEndpoint.php index d172d656..46979f30 100644 --- a/src/Endpoints/OrderRefundEndpoint.php +++ b/src/Endpoints/OrderRefundEndpoint.php @@ -6,7 +6,7 @@ use Mollie\Api\Resources\Refund; use Mollie\Api\Resources\RefundCollection; -class OrderRefundEndpoint extends CollectionRestEndpoint +class OrderRefundEndpoint extends EndpointCollection { protected string $resourcePath = "orders_refunds"; diff --git a/src/Endpoints/PaymentCaptureEndpoint.php b/src/Endpoints/PaymentCaptureEndpoint.php index f3acfd99..2d896a46 100644 --- a/src/Endpoints/PaymentCaptureEndpoint.php +++ b/src/Endpoints/PaymentCaptureEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Payment; -class PaymentCaptureEndpoint extends CollectionRestEndpoint +class PaymentCaptureEndpoint extends EndpointCollection { protected string $resourcePath = "payments_captures"; diff --git a/src/Endpoints/PaymentChargebackEndpoint.php b/src/Endpoints/PaymentChargebackEndpoint.php index 96c52331..b28ca54e 100644 --- a/src/Endpoints/PaymentChargebackEndpoint.php +++ b/src/Endpoints/PaymentChargebackEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\LazyCollection; use Mollie\Api\Resources\Payment; -class PaymentChargebackEndpoint extends CollectionRestEndpoint +class PaymentChargebackEndpoint extends EndpointCollection { protected string $resourcePath = "payments_chargebacks"; diff --git a/src/Endpoints/PaymentEndpoint.php b/src/Endpoints/PaymentEndpoint.php index 90833208..66e50a06 100644 --- a/src/Endpoints/PaymentEndpoint.php +++ b/src/Endpoints/PaymentEndpoint.php @@ -8,7 +8,7 @@ use Mollie\Api\Resources\PaymentCollection; use Mollie\Api\Resources\Refund; -class PaymentEndpoint extends CollectionRestEndpoint +class PaymentEndpoint extends EndpointCollection { protected string $resourcePath = "payments"; diff --git a/src/Endpoints/PaymentLinkEndpoint.php b/src/Endpoints/PaymentLinkEndpoint.php index f6af37b0..d4df8a25 100644 --- a/src/Endpoints/PaymentLinkEndpoint.php +++ b/src/Endpoints/PaymentLinkEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\PaymentLink; use Mollie\Api\Resources\PaymentLinkCollection; -class PaymentLinkEndpoint extends CollectionRestEndpoint +class PaymentLinkEndpoint extends EndpointCollection { protected string $resourcePath = "payment-links"; diff --git a/src/Endpoints/PaymentRefundEndpoint.php b/src/Endpoints/PaymentRefundEndpoint.php index 81dafb81..f86fa69f 100644 --- a/src/Endpoints/PaymentRefundEndpoint.php +++ b/src/Endpoints/PaymentRefundEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\Refund; use Mollie\Api\Resources\RefundCollection; -class PaymentRefundEndpoint extends CollectionRestEndpoint +class PaymentRefundEndpoint extends EndpointCollection { protected string $resourcePath = "payments_refunds"; diff --git a/src/Endpoints/PermissionEndpoint.php b/src/Endpoints/PermissionEndpoint.php index 26abc99e..6672332e 100644 --- a/src/Endpoints/PermissionEndpoint.php +++ b/src/Endpoints/PermissionEndpoint.php @@ -6,7 +6,7 @@ use Mollie\Api\Resources\Permission; use Mollie\Api\Resources\PermissionCollection; -class PermissionEndpoint extends CollectionRestEndpoint +class PermissionEndpoint extends EndpointCollection { protected string $resourcePath = "permissions"; diff --git a/src/Endpoints/ProfileEndpoint.php b/src/Endpoints/ProfileEndpoint.php index 61f8d00f..e25f46c5 100644 --- a/src/Endpoints/ProfileEndpoint.php +++ b/src/Endpoints/ProfileEndpoint.php @@ -8,7 +8,7 @@ use Mollie\Api\Resources\Profile; use Mollie\Api\Resources\ProfileCollection; -class ProfileEndpoint extends CollectionRestEndpoint +class ProfileEndpoint extends EndpointCollection { protected string $resourcePath = "profiles"; diff --git a/src/Endpoints/ProfileMethodEndpoint.php b/src/Endpoints/ProfileMethodEndpoint.php index 688259c0..b616ce5f 100644 --- a/src/Endpoints/ProfileMethodEndpoint.php +++ b/src/Endpoints/ProfileMethodEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\Profile; use Mollie\Api\Resources\ResourceFactory; -class ProfileMethodEndpoint extends CollectionRestEndpoint +class ProfileMethodEndpoint extends EndpointCollection { protected string $resourcePath = "profiles_methods"; diff --git a/src/Endpoints/RefundEndpoint.php b/src/Endpoints/RefundEndpoint.php index 75f49d00..673af604 100644 --- a/src/Endpoints/RefundEndpoint.php +++ b/src/Endpoints/RefundEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\Refund; use Mollie\Api\Resources\RefundCollection; -class RefundEndpoint extends CollectionRestEndpoint +class RefundEndpoint extends EndpointCollection { protected string $resourcePath = "refunds"; diff --git a/src/Endpoints/SettlementCaptureEndpoint.php b/src/Endpoints/SettlementCaptureEndpoint.php index 520f0deb..70f162d9 100644 --- a/src/Endpoints/SettlementCaptureEndpoint.php +++ b/src/Endpoints/SettlementCaptureEndpoint.php @@ -8,7 +8,7 @@ use Mollie\Api\Resources\CaptureCollection; use Mollie\Api\Resources\LazyCollection; -class SettlementCaptureEndpoint extends CollectionRestEndpoint +class SettlementCaptureEndpoint extends EndpointCollection { protected string $resourcePath = "settlements_captures"; diff --git a/src/Endpoints/SettlementChargebackEndpoint.php b/src/Endpoints/SettlementChargebackEndpoint.php index ac6265e6..77de4403 100644 --- a/src/Endpoints/SettlementChargebackEndpoint.php +++ b/src/Endpoints/SettlementChargebackEndpoint.php @@ -8,7 +8,7 @@ use Mollie\Api\Resources\ChargebackCollection; use Mollie\Api\Resources\LazyCollection; -class SettlementChargebackEndpoint extends CollectionRestEndpoint +class SettlementChargebackEndpoint extends EndpointCollection { protected string $resourcePath = "settlements_chargebacks"; diff --git a/src/Endpoints/SettlementPaymentEndpoint.php b/src/Endpoints/SettlementPaymentEndpoint.php index fb27ed72..872bf7a8 100644 --- a/src/Endpoints/SettlementPaymentEndpoint.php +++ b/src/Endpoints/SettlementPaymentEndpoint.php @@ -6,7 +6,7 @@ use Mollie\Api\Resources\Payment; use Mollie\Api\Resources\PaymentCollection; -class SettlementPaymentEndpoint extends CollectionRestEndpoint +class SettlementPaymentEndpoint extends EndpointCollection { protected string $resourcePath = "settlements_payments"; diff --git a/src/Endpoints/SettlementRefundEndpoint.php b/src/Endpoints/SettlementRefundEndpoint.php index 7849c640..c7007f98 100644 --- a/src/Endpoints/SettlementRefundEndpoint.php +++ b/src/Endpoints/SettlementRefundEndpoint.php @@ -8,7 +8,7 @@ use Mollie\Api\Resources\Refund; use Mollie\Api\Resources\RefundCollection; -class SettlementRefundEndpoint extends CollectionRestEndpoint +class SettlementRefundEndpoint extends EndpointCollection { protected string $resourcePath = "settlements_refunds"; diff --git a/src/Endpoints/SettlementsEndpoint.php b/src/Endpoints/SettlementsEndpoint.php index ec7f6c8c..d061d278 100644 --- a/src/Endpoints/SettlementsEndpoint.php +++ b/src/Endpoints/SettlementsEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\Settlement; use Mollie\Api\Resources\SettlementCollection; -class SettlementsEndpoint extends CollectionRestEndpoint +class SettlementsEndpoint extends EndpointCollection { protected string $resourcePath = "settlements"; diff --git a/src/Endpoints/ShipmentEndpoint.php b/src/Endpoints/ShipmentEndpoint.php index 9ada1b9a..1f64b439 100644 --- a/src/Endpoints/ShipmentEndpoint.php +++ b/src/Endpoints/ShipmentEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\Shipment; use Mollie\Api\Resources\ShipmentCollection; -class ShipmentEndpoint extends CollectionRestEndpoint +class ShipmentEndpoint extends EndpointCollection { protected string $resourcePath = "orders_shipments"; diff --git a/src/Endpoints/SubscriptionEndpoint.php b/src/Endpoints/SubscriptionEndpoint.php index 79e1a8ac..76338f22 100644 --- a/src/Endpoints/SubscriptionEndpoint.php +++ b/src/Endpoints/SubscriptionEndpoint.php @@ -8,7 +8,7 @@ use Mollie\Api\Resources\Subscription; use Mollie\Api\Resources\SubscriptionCollection; -class SubscriptionEndpoint extends CollectionRestEndpoint +class SubscriptionEndpoint extends EndpointCollection { protected string $resourcePath = "customers_subscriptions"; diff --git a/src/Endpoints/TerminalEndpoint.php b/src/Endpoints/TerminalEndpoint.php index 3ca6a89b..0678827a 100644 --- a/src/Endpoints/TerminalEndpoint.php +++ b/src/Endpoints/TerminalEndpoint.php @@ -7,7 +7,7 @@ use Mollie\Api\Resources\Terminal; use Mollie\Api\Resources\TerminalCollection; -class TerminalEndpoint extends CollectionRestEndpoint +class TerminalEndpoint extends EndpointCollection { protected string $resourcePath = "terminals"; diff --git a/src/Resources/ResourceFactory.php b/src/Resources/ResourceFactory.php index 8951dc57..07a3a845 100644 --- a/src/Resources/ResourceFactory.php +++ b/src/Resources/ResourceFactory.php @@ -34,9 +34,9 @@ public static function createFromApiResult(object $apiResult, BaseResource $reso public static function createBaseResourceCollection( MollieApiClient $client, string $resourceClass, - array $data, - object $_links = null, - string $resourceCollectionClass = null + ?array $data = null, + ?object $_links = null, + ?string $resourceCollectionClass = null ): BaseCollection { $resourceCollectionClass = $resourceCollectionClass ?: $resourceClass . 'Collection'; $data = $data ?: []; @@ -61,8 +61,8 @@ public static function createCursorResourceCollection( MollieApiClient $client, array $input, string $resourceClass, - object $_links = null, - string $resourceCollectionClass = null + ?object $_links = null, + ?string $resourceCollectionClass = null ): CursorCollection { if (null === $resourceCollectionClass) { $resourceCollectionClass = $resourceClass . 'Collection'; diff --git a/tests/Mollie/API/Endpoints/OrderLineEndpointTest.php b/tests/Mollie/API/Endpoints/OrderLineEndpointTest.php index 75079cec..601ce439 100644 --- a/tests/Mollie/API/Endpoints/OrderLineEndpointTest.php +++ b/tests/Mollie/API/Endpoints/OrderLineEndpointTest.php @@ -18,7 +18,10 @@ public function testCancelLinesRequiresLinesArray() $this->guzzleClient = $this->createMock(Client::class); $this->apiClient = new MollieApiClient($this->guzzleClient); - $this->apiClient->orderLines->cancelFor(new Order($this->apiClient), []); + $order = new Order($this->apiClient); + $order->id = 'ord_pbjz8x'; + + $this->apiClient->orderLines->cancelFor($order, []); } public function testUpdateMultipleOrderLines()