From e8fb8c5e7c9686841f07bd0a5361a9a6655ad11e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 7 Jan 2026 10:35:55 +0000 Subject: [PATCH 1/2] Fix LedgerAccount test stubs to match API documentation The test stubs incorrectly used boolean `true` for allowed_document_types, but the Moneybird API returns an array of strings (e.g., ["sales_invoice", "purchase_invoice"]). Updated stubs to match the actual API response format. --- .../Api/LedgerAccounts/LedgerAccountsResponseStub.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Api/LedgerAccounts/LedgerAccountsResponseStub.php b/tests/Api/LedgerAccounts/LedgerAccountsResponseStub.php index 3179258..258afb4 100644 --- a/tests/Api/LedgerAccounts/LedgerAccountsResponseStub.php +++ b/tests/Api/LedgerAccounts/LedgerAccountsResponseStub.php @@ -16,7 +16,7 @@ public static function getAll(): string "account_type": "revenue", "account_id": "1000", "parent": false, - "allowed_document_types": true, + "allowed_document_types": ["sales_invoice", "purchase_invoice"], "description": "Revenue account", "created_at": "2023-01-01T12:00:00.000Z", "updated_at": "2023-01-01T12:00:00.000Z" @@ -28,7 +28,7 @@ public static function getAll(): string "account_type": "expense", "account_id": "2000", "parent": false, - "allowed_document_types": true, + "allowed_document_types": ["sales_invoice", "purchase_invoice"], "description": "Expense account", "created_at": "2023-01-02T12:00:00.000Z", "updated_at": "2023-01-02T12:00:00.000Z" @@ -45,7 +45,7 @@ public static function get(): string "account_type": "revenue", "account_id": "1000", "parent": false, - "allowed_document_types": true, + "allowed_document_types": ["sales_invoice", "purchase_invoice"], "description": "Revenue account", "created_at": "2023-01-01T12:00:00.000Z", "updated_at": "2023-01-01T12:00:00.000Z" @@ -61,7 +61,7 @@ public static function create(): string "account_type": "revenue", "account_id": "3000", "parent": false, - "allowed_document_types": true, + "allowed_document_types": ["sales_invoice", "purchase_invoice"], "description": "New revenue account", "created_at": "2023-01-03T12:00:00.000Z", "updated_at": "2023-01-03T12:00:00.000Z" @@ -77,7 +77,7 @@ public static function update(): string "account_type": "revenue", "account_id": "1000", "parent": false, - "allowed_document_types": true, + "allowed_document_types": ["sales_invoice", "purchase_invoice"], "description": "Updated revenue account", "created_at": "2023-01-01T12:00:00.000Z", "updated_at": "2023-01-03T12:00:00.000Z" From 49bc2c46893ac50d1623ed7c48e7044e69160e31 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 7 Jan 2026 10:42:14 +0000 Subject: [PATCH 2/2] Disable rate limiting in tests The rate limiter middleware runs even for mocked requests, causing tests to fail after hitting the 150 request limit. Disabling rate limiting for mocked clients ensures tests run reliably. --- tests/Api/BaseTestCase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Api/BaseTestCase.php b/tests/Api/BaseTestCase.php index aaffc22..aa0c1fc 100644 --- a/tests/Api/BaseTestCase.php +++ b/tests/Api/BaseTestCase.php @@ -27,6 +27,7 @@ protected function getMoneybirdClientWithMocks(array $mocks = []): MoneybirdApiC { return $this ->getMoneybirdClient() + ->disableRateLimiting() ->withMockClient( mockClient: new MockClient(mockData: $mocks) );