add school calendar logic
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Resources\Settings;
|
||||
|
||||
use App\Http\Resources\Settings\SchoolCalendarEventResource;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SchoolCalendarEventResourceTest extends TestCase
|
||||
{
|
||||
public function test_resource_returns_expected_shape(): void
|
||||
{
|
||||
$resource = new SchoolCalendarEventResource([
|
||||
'id' => 1,
|
||||
'title' => 'Event',
|
||||
'start' => '2026-01-01',
|
||||
'description' => 'Desc',
|
||||
'extendedProps' => ['no_school' => 0],
|
||||
]);
|
||||
|
||||
$payload = $resource->toArray(request());
|
||||
|
||||
$this->assertArrayHasKey('id', $payload);
|
||||
$this->assertArrayHasKey('title', $payload);
|
||||
$this->assertArrayHasKey('start', $payload);
|
||||
$this->assertArrayHasKey('description', $payload);
|
||||
$this->assertArrayHasKey('extendedProps', $payload);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user