ValidityTimeType::TimeWindow, 'start_time' => '11:00:00', 'end_time' => null, 'fixed_starts_at' => '2026-08-20 10:00:00', ]))->resolve(); $this->assertSame('time_window', $resource['type']); $this->assertTrue($resource['is_valid']); $this->assertSame('11:00:00', $resource['start_time']); $this->assertArrayNotHasKey('end_time', $resource); $this->assertArrayNotHasKey('fixed_starts_at', $resource); $this->assertArrayNotHasKey('fixed_expires_at', $resource); } public function test_fixed_window_only_contains_non_null_datetime_fields(): void { Carbon::setTestNow('2026-08-20 11:00:00'); $resource = ValidityTimeResource::make(new ValidityTime([ 'type' => ValidityTimeType::FixedWindow, 'start_time' => '11:00:00', 'fixed_starts_at' => '2026-08-20 10:00:00', 'fixed_expires_at' => null, ]))->resolve(); $this->assertSame('fixed_window', $resource['type']); $this->assertTrue($resource['is_valid']); $this->assertArrayHasKey('fixed_starts_at', $resource); $this->assertArrayNotHasKey('fixed_expires_at', $resource); $this->assertArrayNotHasKey('start_time', $resource); $this->assertArrayNotHasKey('end_time', $resource); } }