a797ff9e24
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
22 lines
689 B
PHP
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');
|
|
});
|