feat(external): CaptchaLivenessProbe — статус капчи
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?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');
|
||||
});
|
||||
Reference in New Issue
Block a user