From 4d331457eab8afe7335cfdbda6dee76eeec63ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Tue, 19 May 2026 16:03:36 +0300 Subject: [PATCH] test(supplier): lock HTTP-200-without-Content-Type contract (no login-detect false-positive) --- app/tests/Unit/Supplier/SupplierPortalClientTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/tests/Unit/Supplier/SupplierPortalClientTest.php b/app/tests/Unit/Supplier/SupplierPortalClientTest.php index ed3d17e5..ef9d1f95 100644 --- a/app/tests/Unit/Supplier/SupplierPortalClientTest.php +++ b/app/tests/Unit/Supplier/SupplierPortalClientTest.php @@ -275,3 +275,14 @@ test('JSON response with substring "loginform-username" is NOT misclassified as expect($result)->toHaveCount(1); Http::assertSentCount(1); // no retry — JSON header skips login-detect }); + +test('200 response without Content-Type header is NOT detected as login page', function (): void { + // Документирует контракт: пустой Content-Type → str_starts_with('','text/html') === false → детект пропускается. + Http::fake([ + 'crm.bp-gr.ru/*' => Http::response('{"projects":[]}', 200), // no Content-Type header + ]); + + app(SupplierPortalClient::class)->listProjects(); + + Http::assertSentCount(1); // no retry — empty Content-Type fails the text/html gate +});