From 227c0abcc6c438c2f471d45916b62dd26229880e Mon Sep 17 00:00:00 2001 From: sampoyigi <6567634+sampoyigi@users.noreply.github.com> Date: Sun, 5 Jul 2026 11:22:30 +0100 Subject: [PATCH 1/2] test(orders): sync payments before testing `payment_method` relationship --- src/Exceptions/ErrorHandler.php | 2 +- tests/ApiResources/OrdersTest.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Exceptions/ErrorHandler.php b/src/Exceptions/ErrorHandler.php index 3e4222d..9415631 100644 --- a/src/Exceptions/ErrorHandler.php +++ b/src/Exceptions/ErrorHandler.php @@ -86,7 +86,7 @@ protected function genericResponse(Throwable $exception): Response * * @return int */ - protected function getStatusCode(Throwable $exception) + protected function getStatusCode(Throwable $exception): float|string|int { // By default throw 500 $statusCode = $exception->getCode() ?: 500; diff --git a/tests/ApiResources/OrdersTest.php b/tests/ApiResources/OrdersTest.php index 7274b4e..471db58 100644 --- a/tests/ApiResources/OrdersTest.php +++ b/tests/ApiResources/OrdersTest.php @@ -7,6 +7,7 @@ use Igniter\Admin\Models\Status; use Igniter\Cart\Models\Order; use Igniter\Local\Models\Location; +use Igniter\PayRegister\Models\Payment; use Igniter\User\Models\Address; use Igniter\User\Models\Customer; use Igniter\User\Models\User; @@ -82,6 +83,8 @@ }); it('shows an order with payment_method relationship', function(): void { + Payment::syncAll(); + Sanctum::actingAs(User::factory()->create(), ['orders:*']); $order = Order::factory()->create([ 'payment' => 'cod', From 52840ed1e3a21d73f06c4e47592e57807796076b Mon Sep 17 00:00:00 2001 From: sampoyigi <6567634+sampoyigi@users.noreply.github.com> Date: Sun, 19 Jul 2026 23:20:29 +0100 Subject: [PATCH 2/2] ci(github-actions): restrict pipeline trigger to `4.x` branch only --- .github/workflows/pipeline.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index a294039..4fd7d56 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -1,6 +1,10 @@ name: CI Pipeline -on: [ push, workflow_dispatch ] +on: + push: + branches: + - 4.x + workflow_dispatch: jobs: php-tests: