rules(); $validValidator = Validator::make([ 'active_students_min' => 10, 'active_students_max' => 90, ], $rules); $this->assertFalse($validValidator->errors()->has('active_students_min')); $this->assertFalse($validValidator->errors()->has('active_students_max')); $invalidValidator = Validator::make([ 'active_students_min' => -5, // Below 0 'active_students_max' => 'string', // Not an integer ], $rules); $this->assertTrue($invalidValidator->errors()->has('active_students_min')); $this->assertTrue($invalidValidator->errors()->has('active_students_max')); } public function test_unit_resource_includes_active_students_ranges(): void { $unit = current(array_filter([new class extends Unit { public $active_students_min = 25; public $active_students_max = 85; public $name = 'Teste'; public $social_reason = 'Teste'; }])); $resource = new UnitResource($unit); $array = $resource->toArray(Request::create('/')); $this->assertArrayHasKey('active_students_min', $array); $this->assertArrayHasKey('active_students_max', $array); $this->assertSame(25, $array['active_students_min']); $this->assertSame(85, $array['active_students_max']); } }