update project
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace Tests\Unit\SchoolCore\Students;
|
||||
use App\Domain\SchoolCore\Context\SchoolContext; use App\Domain\SchoolCore\Students\DTO\StudentView; use App\Domain\SchoolCore\Students\Policies\DefaultStudentIdentifierGenerator; use PHPUnit\Framework\TestCase;
|
||||
final class DefaultStudentIdentifierGeneratorTest extends TestCase { public function test_generates_identifier_from_persisted_student_id(): void { $ctx=new SchoolContext(1,9,[1],'2026','spring','America/New_York','en','USD','standard_school'); $id=(new DefaultStudentIdentifierGenerator())->generateForPersistedStudent($ctx,new StudentView(123,1,null,'A','B')); $this->assertSame('SCH-0000123',(string)$id); } }
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\SchoolCore\Students;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
use App\Domain\SchoolCore\Students\Services\SequentialStudentIdentifierGenerator;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class SequentialStudentIdentifierGeneratorTest extends TestCase
|
||||
{
|
||||
public function test_it_generates_identifier_after_student_id_exists(): void
|
||||
{
|
||||
$context = new SchoolContext(12, 44, [], '2025', 'spring', 'UTC', 'en', 'USD', 'standard_school');
|
||||
$identifier = (new SequentialStudentIdentifierGenerator())->generate($context, 991);
|
||||
$this->assertSame('12-000991', $identifier);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
namespace Tests\Unit\SchoolCore\Students;
|
||||
use App\Domain\SchoolCore\Students\Exceptions\InvalidStudentStatusTransitionException; use App\Domain\SchoolCore\Students\Support\StudentLifecycleStateMachine; use PHPUnit\Framework\TestCase;
|
||||
final class StudentLifecycleStateMachineTest extends TestCase { public function test_allows_valid_transition(): void { (new StudentLifecycleStateMachine())->assertCanTransition('active','withdrawn'); $this->assertTrue(true); } public function test_rejects_invalid_transition(): void { $this->expectException(InvalidStudentStatusTransitionException::class); (new StudentLifecycleStateMachine())->assertCanTransition('archived','active'); } }
|
||||
Reference in New Issue
Block a user