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
@@ -47,7 +47,7 @@ class WhatsappContactServiceTest extends TestCase
'updated_at' => now(),
]);
$service = new WhatsappContactService(new WhatsappContextService);
$service = new WhatsappContactService(new WhatsappContextService());
$contacts = $service->listParentContacts('2025-2026', 'Fall');
$this->assertCount(2, $contacts);
@@ -13,7 +13,7 @@ class WhatsappContextServiceTest extends TestCase
public function test_school_year_aliases_generate_expected_values(): void
{
$service = new WhatsappContextService;
$service = new WhatsappContextService();
[$aliases, $canonical, $startYear] = $service->schoolYearAliases('2025/2026');
$this->assertContains('2025-2026', $aliases);
@@ -33,7 +33,7 @@ class WhatsappContextServiceTest extends TestCase
'updated_at' => now(),
]);
$service = new WhatsappContextService;
$service = new WhatsappContextService();
$this->assertTrue($service->hasRosterForYear('2025-2026'));
$this->assertFalse($service->hasRosterForYear('2030-2031'));
@@ -77,7 +77,7 @@ class WhatsappInviteBundleServiceTest extends TestCase
],
];
$service = new WhatsappInviteBundleService;
$service = new WhatsappInviteBundleService();
$bundle = $service->bundleForParent(10, $linkBySection, '2025-2026', 'Fall');
$this->assertNotNull($bundle);
@@ -87,7 +87,7 @@ class WhatsappInviteBundleServiceTest extends TestCase
public function test_consolidate_bundles_merges_by_parent(): void
{
$service = new WhatsappInviteBundleService;
$service = new WhatsappInviteBundleService();
$merged = $service->consolidateBundles([
[
@@ -14,7 +14,7 @@ class WhatsappInviteNotificationServiceTest extends TestCase
public function test_dispatch_returns_error_when_no_listeners(): void
{
$service = new WhatsappInviteNotificationService;
$service = new WhatsappInviteNotificationService();
$result = $service->dispatch([], '2025-2026', 'Fall');
$this->assertFalse($result['ok']);
@@ -22,9 +22,10 @@ class WhatsappInviteNotificationServiceTest extends TestCase
public function test_dispatch_triggers_event_when_listener_registered(): void
{
Event::listen(WhatsappInvitesSend::class, static function () {});
Event::listen(WhatsappInvitesSend::class, static function () {
});
$service = new WhatsappInviteNotificationService;
$service = new WhatsappInviteNotificationService();
$result = $service->dispatch([[
'parent' => ['id' => 10],
'emails' => ['parent1@example.com'],
@@ -19,12 +19,13 @@ class WhatsappInviteServiceTest extends TestCase
public function test_send_returns_success_for_parent_mode(): void
{
$this->seedInviteData();
Event::listen(WhatsappInvitesSend::class, static function () {});
Event::listen(WhatsappInvitesSend::class, static function () {
});
$service = new WhatsappInviteService(
new WhatsappContextService,
new WhatsappInviteBundleService,
new WhatsappInviteNotificationService
new WhatsappContextService(),
new WhatsappInviteBundleService(),
new WhatsappInviteNotificationService()
);
$result = $service->send([
@@ -14,7 +14,7 @@ class WhatsappLinkServiceTest extends TestCase
public function test_upsert_creates_link(): void
{
$service = new WhatsappLinkService(new WhatsappContextService);
$service = new WhatsappLinkService(new WhatsappContextService());
$link = $service->upsert([
'class_section_id' => 300,
@@ -57,7 +57,7 @@ class WhatsappLinkServiceTest extends TestCase
],
]);
$service = new WhatsappLinkService(new WhatsappContextService);
$service = new WhatsappLinkService(new WhatsappContextService());
$page = $service->paginate(['active' => true]);
$this->assertCount(1, $page->items());
@@ -13,7 +13,7 @@ class WhatsappMembershipServiceTest extends TestCase
public function test_update_membership_saves_primary(): void
{
$service = new WhatsappMembershipService;
$service = new WhatsappMembershipService();
$result = $service->updateMembership([
'class_section_id' => 200,
@@ -36,7 +36,7 @@ class WhatsappMembershipServiceTest extends TestCase
{
Schema::shouldReceive('hasTable')->with('whatsapp_group_memberships')->andReturn(false);
$service = new WhatsappMembershipService;
$service = new WhatsappMembershipService();
$result = $service->updateMembership([
'class_section_id' => 200,
'primary_id' => 10,