Files
portal/app/tests/Unit/External/CaptchaLivenessProbeTest.php
T
Дмитрий a797ff9e24 feat(external): CaptchaLivenessProbe — статус капчи
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 09:03:52 +03:00

22 lines
689 B
PHP

<?php
declare(strict_types=1);
use App\Services\External\CaptchaLivenessProbe;
use Tests\TestCase;
uses(TestCase::class); // нужен booted-app: config()
it('серый «выключена», когда driver=null', function () {
config()->set('services.captcha.driver', 'null');
$r = (new CaptchaLivenessProbe)->check();
expect($r->serviceKey)->toBe('captcha');
expect($r->light)->toBe('grey');
expect($r->detail)->toContain('выключена');
});
it('зелёный, когда капча включена', function () {
config()->set('services.captcha.driver', 'yandex');
expect((new CaptchaLivenessProbe)->check()->light)->toBe('green');
});