From 1c9a93bca8b183675754b8c03b15669338e3a38d Mon Sep 17 00:00:00 2001 From: zds <49744633+zds-s@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:21:58 +0800 Subject: [PATCH] fixed ci --- .github/workflows/web.yml | 2 +- tests/Feature/Admin/CrudControllerCase.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 23264c7c..dc23699e 100755 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -40,7 +40,7 @@ jobs: - name: Setup Node - uses: ./.github/actions/setup-node/ + uses: ./.github/actions/setup-node # - name: Check Git version # run: git --version diff --git a/tests/Feature/Admin/CrudControllerCase.php b/tests/Feature/Admin/CrudControllerCase.php index 9552b633..be18312c 100644 --- a/tests/Feature/Admin/CrudControllerCase.php +++ b/tests/Feature/Admin/CrudControllerCase.php @@ -58,8 +58,9 @@ public function caseCreate(string $uri, string $roleCode, array $fillable, strin $this->assertTrue($enforce->deletePermissionForUser($this->user->username, $roleCode)); $result = $this->post($uri, $fillable, ['Authorization' => 'Bearer ' . $token]); $this->assertSame($result['code'], ResultCode::FORBIDDEN->value); - $entity = $model::query()->where($fillable)->first(); - if ($required) { + try { + $entity = $model::query()->where($fillable)->first(); + }catch (\Exception $e){ $entity = $model::query()->where(Arr::only($fillable, $required))->first(); } if (empty($entity)) {