From 0dabc4ebb519a1c57ec951aa3682d3c2b96246fb Mon Sep 17 00:00:00 2001 From: Hank Date: Mon, 8 Jun 2026 04:01:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(test):=20=E4=BF=AE=E6=AD=A3=20AuthRateLimit?= =?UTF-8?q?Test=20=E9=81=8E=E6=9C=9F=E7=9A=84=20throttle=20=E9=96=80?= =?UTF-8?q?=E6=AA=BB=E6=96=B7=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 2a0e9255(P2 帳號鎖定上線)已將 member/provider 登入的 IP throttle 從 5,1 調整為 10,1(避免 IP throttle 搶在帳號鎖定的 423 之前觸發 429), 但測試的迴圈次數與註解仍停留在舊版 5,1,導致預期 429 卻收到 401。 同步將迴圈次數改為 10、區塊註解改為 throttle:10,1,使其對齊現行設定。 Co-Authored-By: Claude Sonnet 4.6 --- tests/Feature/AuthRateLimitTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Feature/AuthRateLimitTest.php b/tests/Feature/AuthRateLimitTest.php index 0e7da98..fd79e5d 100644 --- a/tests/Feature/AuthRateLimitTest.php +++ b/tests/Feature/AuthRateLimitTest.php @@ -17,11 +17,11 @@ class AuthRateLimitTest extends TestCase Cache::flush(); } - // ── member (throttle:5,1) ──────────────────────────────── + // ── member (throttle:10,1) ─────────────────────────────── public function test_member_login_within_limit_is_not_throttled(): void { - for ($i = 0; $i < 5; $i++) { + for ($i = 0; $i < 10; $i++) { $response = $this->postJson('/api/member/login', [ 'email' => 'notexist@example.com', 'password' => 'wrong', @@ -32,7 +32,7 @@ class AuthRateLimitTest extends TestCase public function test_member_login_exceeds_limit_returns_429(): void { - for ($i = 0; $i < 5; $i++) { + for ($i = 0; $i < 10; $i++) { $this->postJson('/api/member/login', [ 'email' => 'notexist@example.com', 'password' => 'wrong', @@ -48,11 +48,11 @@ class AuthRateLimitTest extends TestCase $this->assertTrue($response->headers->has('Retry-After')); } - // ── provider (throttle:5,1) ────────────────────────────── + // ── provider (throttle:10,1) ───────────────────────────── public function test_provider_login_exceeds_limit_returns_429(): void { - for ($i = 0; $i < 5; $i++) { + for ($i = 0; $i < 10; $i++) { $this->postJson('/api/provider/login', [ 'email' => 'notexist@example.com', 'password' => 'wrong',