add test batches

This commit is contained in:
root
2026-06-08 23:45:55 -04:00
parent c792b8be05
commit 8d4d610b82
1480 changed files with 22587 additions and 10762 deletions
@@ -18,7 +18,7 @@ class PasswordResetCleanupServiceTest extends TestCase
['ip_address' => '127.0.0.1', 'requested_at' => now()->subDays(5)],
]);
$service = new PasswordResetCleanupService;
$service = new PasswordResetCleanupService();
$deleted = $service->cleanup(30);
$this->assertSame(1, $deleted);
@@ -34,7 +34,7 @@ class PermissionCheckServiceTest extends TestCase
'can_read' => 1,
]);
$service = new PermissionCheckService;
$service = new PermissionCheckService();
$this->assertTrue($service->hasPermission(10, 'edit_students'));
$this->assertFalse($service->hasPermission(10, 'missing_perm'));
@@ -12,7 +12,7 @@ class RegistrationCaptchaServiceTest extends TestCase
public function test_generate_sets_cache_value(): void
{
$service = new RegistrationCaptchaService;
$service = new RegistrationCaptchaService();
$value = $service->generate(6);
$this->assertNotEmpty($value);
@@ -21,7 +21,7 @@ class RegistrationCaptchaServiceTest extends TestCase
public function test_verify_and_clear(): void
{
$service = new RegistrationCaptchaService;
$service = new RegistrationCaptchaService();
$value = $service->generate(6);
$this->assertTrue($service->verify($value));
@@ -13,7 +13,7 @@ class RegistrationFormatterServiceTest extends TestCase
public function test_format_normalizes_parent_fields(): void
{
$formatter = new RegistrationFormatterService(new PhoneFormatterService);
$formatter = new RegistrationFormatterService(new PhoneFormatterService());
$result = $formatter->format([
'firstname' => 'john',
@@ -41,7 +41,7 @@ class RegistrationFormatterServiceTest extends TestCase
public function test_format_includes_second_parent_when_present(): void
{
$formatter = new RegistrationFormatterService(new PhoneFormatterService);
$formatter = new RegistrationFormatterService(new PhoneFormatterService());
$result = $formatter->format([
'firstname' => 'john',
@@ -35,7 +35,7 @@ class RegistrationServiceTest extends TestCase
'is_active' => 1,
]);
$captchaService = new RegistrationCaptchaService;
$captchaService = new RegistrationCaptchaService();
$captcha = $captchaService->generate(4);
$emailService = Mockery::mock(EmailService::class);
@@ -43,8 +43,8 @@ class RegistrationServiceTest extends TestCase
$service = new RegistrationService(
$emailService,
new SchoolIdService,
new RegistrationFormatterService(new PhoneFormatterService),
new SchoolIdService(),
new RegistrationFormatterService(new PhoneFormatterService()),
$captchaService
);
@@ -115,7 +115,7 @@ class RegistrationServiceTest extends TestCase
'token' => 'token',
]);
$captchaService = new RegistrationCaptchaService;
$captchaService = new RegistrationCaptchaService();
$captcha = $captchaService->generate(4);
$emailService = Mockery::mock(EmailService::class);
@@ -123,8 +123,8 @@ class RegistrationServiceTest extends TestCase
$service = new RegistrationService(
$emailService,
new SchoolIdService,
new RegistrationFormatterService(new PhoneFormatterService),
new SchoolIdService(),
new RegistrationFormatterService(new PhoneFormatterService()),
$captchaService
);
@@ -35,7 +35,7 @@ class UserRoleServiceTest extends TestCase
'can_manage' => 0,
]);
$service = new UserRoleService;
$service = new UserRoleService();
$roleIds = $service->getRoleIds(5);
$this->assertTrue($service->hasPermissionForCrud($roleIds, 'manage_students', 'read'));