add school year model
This commit is contained in:
@@ -15,7 +15,7 @@ class EmailExtractorControllerTest extends TestCase
|
||||
public function test_emails_endpoint_returns_users_and_parents(): void
|
||||
{
|
||||
$user = $this->createUser();
|
||||
Sanctum::actingAs($user);
|
||||
Sanctum::actingAs($user, [], 'api');
|
||||
|
||||
DB::table('parents')->insert([
|
||||
'secondparent_firstname' => 'Parent',
|
||||
@@ -31,13 +31,38 @@ class EmailExtractorControllerTest extends TestCase
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertJsonPath('ok', true);
|
||||
$this->assertContains('admin@example.com', $response->json('users'));
|
||||
$this->assertContains('parent2@example.com', $response->json('parents'));
|
||||
$this->assertContains('parent2@example.com', $response->json('emails.parents'));
|
||||
}
|
||||
|
||||
public function test_legacy_emails_endpoint_returns_top_level_arrays(): void
|
||||
{
|
||||
$user = $this->createUser();
|
||||
Sanctum::actingAs($user, [], 'api');
|
||||
|
||||
DB::table('parents')->insert([
|
||||
'secondparent_firstname' => 'Parent',
|
||||
'secondparent_lastname' => 'Legacy',
|
||||
'secondparent_email' => 'legacy-parent@example.com',
|
||||
'secondparent_phone' => '5555555555',
|
||||
'firstparent_id' => 1,
|
||||
'secondparent_id' => 3,
|
||||
'school_year' => '2025-2026',
|
||||
]);
|
||||
|
||||
$response = $this->getJson('/api/emails');
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertJsonPath('ok', true);
|
||||
$this->assertContains('admin@example.com', $response->json('users'));
|
||||
$this->assertContains('legacy-parent@example.com', $response->json('parents'));
|
||||
}
|
||||
|
||||
public function test_compare_endpoint_returns_comparison(): void
|
||||
{
|
||||
$user = $this->createUser();
|
||||
Sanctum::actingAs($user);
|
||||
Sanctum::actingAs($user, [], 'api');
|
||||
|
||||
DB::table('parents')->insert([
|
||||
'secondparent_firstname' => 'Parent',
|
||||
|
||||
Reference in New Issue
Block a user