update project
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\IslamicSundaySchool\Attendance;
|
||||
|
||||
use App\Domain\IslamicSundaySchool\Attendance\Policies\IslamicSundaySchoolAttendanceStatusPolicy;
|
||||
use App\Domain\SchoolCore\Attendance\DTO\AttendanceSessionView;
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
use DateTimeImmutable;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class IslamicSundaySchoolAttendanceStatusPolicyTest extends TestCase
|
||||
{
|
||||
public function test_extension_can_use_different_late_window_without_changing_core(): void
|
||||
{
|
||||
$context = new SchoolContext(1, 10, [], '2026', 'spring', 'UTC', 'en', 'USD', 'islamic_sunday_school');
|
||||
$session = new AttendanceSessionView(1, 1, 'Program Session', 'program', new DateTimeImmutable('2026-05-29 09:00:00'), new DateTimeImmutable('2026-05-29 12:00:00'), 'UTC');
|
||||
$policy = new IslamicSundaySchoolAttendanceStatusPolicy();
|
||||
|
||||
$this->assertSame('present', $policy->statusForScan($context, $session, new DateTimeImmutable('2026-05-29 09:14:00'))->status);
|
||||
$this->assertSame('late', $policy->statusForScan($context, $session, new DateTimeImmutable('2026-05-29 09:16:00'))->status);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\IslamicSundaySchool;
|
||||
|
||||
use App\Domain\IslamicSundaySchool\Attendance\IslamicSundaySchoolAttendancePolicy;
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class AttendancePolicyTest extends TestCase
|
||||
{
|
||||
public function test_it_treats_sunday_as_school_day(): void
|
||||
{
|
||||
$context = new SchoolContext(1, 2, [], '2025', 'spring', 'UTC', 'en', 'USD', 'islamic_sunday_school');
|
||||
$policy = new IslamicSundaySchoolAttendancePolicy();
|
||||
|
||||
$this->assertTrue($policy->isSchoolDay($context, new \DateTimeImmutable('2026-05-31')));
|
||||
$this->assertFalse($policy->isSchoolDay($context, new \DateTimeImmutable('2026-05-30')));
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
<?php declare(strict_types=1); namespace Tests\Unit\IslamicSundaySchool\Communication; use App\Domain\IslamicSundaySchool\Communication\Templates\IslamicSundaySchoolTemplateCatalog; use PHPUnit\Framework\TestCase; final class IslamicSundaySchoolCommunicationExtensionTest extends TestCase { public function test_template_catalog_is_extension_owned(): void { $this->assertArrayHasKey('program_class_reminder',(new IslamicSundaySchoolTemplateCatalog())->templates()); } }
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Domain\IslamicSundaySchool\Reporting\Reports\QuranProgressReport;
|
||||
|
||||
final class IslamicSundaySchoolReportAvailabilityTest extends TestCase
|
||||
{
|
||||
public function test_islamic_report_only_available_for_islamic_profile(): void
|
||||
{
|
||||
$report = new QuranProgressReport();
|
||||
$this->assertTrue($report->availableForDomainProfile('islamic_sunday_school'));
|
||||
$this->assertFalse($report->availableForDomainProfile('standard_school'));
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace Tests\Unit\IslamicSundaySchool\Students;
|
||||
use App\Domain\IslamicSundaySchool\Students\Policies\IslamicSundaySchoolStudentIdentifierGenerator; use App\Domain\SchoolCore\Context\SchoolContext; use App\Domain\SchoolCore\Students\DTO\StudentView; use PHPUnit\Framework\TestCase;
|
||||
final class IslamicSundaySchoolStudentIdentifierGeneratorTest extends TestCase { public function test_generates_extension_identifier_without_changing_core(): void { $ctx=new SchoolContext(1,9,[1],'2026','spring','America/New_York','en','USD','islamic_sunday_school'); $id=(new IslamicSundaySchoolStudentIdentifierGenerator())->generateForPersistedStudent($ctx,new StudentView(55,1,null,'A','B')); $this->assertStringStartsWith('SS-',(string)$id); $this->assertStringEndsWith('-000055',(string)$id); } }
|
||||
Reference in New Issue
Block a user