- Use cases: FindAllIncoSheets & FindIncoSheet (filters, pagination, short projection) - Presentation: controllers, FormRequests with scalar validation, DTOs (camelCase) - Ports & Adapters: IncoSheetDirectory & EloquentIncoSheetDirectory - Tests: Pest 4 unit, integration, OpenAPI spectator conformance, dynamic arch tests - Docs: updated Bruno collection and OpenAPI spec
27 lines
741 B
PHP
27 lines
741 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Integration\Infra\Database\Models;
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Infra\Database\Models\Employee;
|
|
use Tests\TestCase;
|
|
|
|
covers(Employee::class);
|
|
|
|
uses(TestCase::class, RefreshDatabase::class);
|
|
|
|
describe('Employee Eloquent Model & Factory', function (): void {
|
|
it('creates and persists an Employee record via factory', function (): void {
|
|
// GIVEN
|
|
$employee = Employee::factory()->create();
|
|
|
|
// WHEN
|
|
$retrieved = Employee::find($employee->public_employee_number);
|
|
|
|
// THEN
|
|
expect($retrieved)->not->toBeNull()
|
|
->and($retrieved->public_employee_number)->toBe($employee->public_employee_number);
|
|
});
|
|
});
|