add all controllers logic

This commit is contained in:
root
2026-03-11 17:53:15 -04:00
parent 3e6c577085
commit 2ef71cc92b
421 changed files with 12009 additions and 5211 deletions
@@ -10,24 +10,24 @@ class RegistrationCaptchaServiceTest extends TestCase
{
use RefreshDatabase;
public function test_generate_sets_session_value(): void
public function test_generate_sets_cache_value(): void
{
$service = new RegistrationCaptchaService();
$value = $service->generate(6);
$this->assertNotEmpty($value);
$this->assertSame($value, session()->get('captcha_answer'));
$this->assertTrue($service->verify($value));
}
public function test_verify_and_clear(): void
{
$service = new RegistrationCaptchaService();
session()->put('captcha_answer', 'ABC123');
$value = $service->generate(6);
$this->assertTrue($service->verify('ABC123'));
$this->assertTrue($service->verify($value));
$this->assertFalse($service->verify('WRONG'));
$service->clear();
$this->assertNull(session()->get('captcha_answer'));
$this->assertFalse($service->verify($value));
}
}