is_null($buildup) ? null : new Carbon($buildup)]); config(['teardown_end' => is_null($teardown) ? null : new Carbon($teardown)]); $check = new ChecksArrivalsAndDeparturesImplementation(); $this->assertFalse($check->checkArrival($arrival, $departure)); } /** * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::isDepartureDateValid * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::toCarbon * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::isBeforeBuildup * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::isAfterTeardown * @dataProvider invalidDepartureCombinations */ public function testCheckInvalidDatesForDeparture( ?string $buildup, ?string $teardown, ?string $arrival, ?string $departure ) { config(['buildup_start' => is_null($buildup) ? null : new Carbon($buildup)]); config(['teardown_end' => is_null($teardown) ? null : new Carbon($teardown)]); $check = new ChecksArrivalsAndDeparturesImplementation(); $this->assertFalse($check->checkDeparture($arrival, $departure)); } /** * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::isArrivalDateValid * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::toCarbon * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::isBeforeBuildup * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::isAfterTeardown * @dataProvider validArrivalCombinations */ public function testCheckValidDatesForArrival( ?string $buildup, ?string $teardown, ?string $arrival, ?string $departure ) { config(['buildup_start' => is_null($buildup) ? null : new Carbon($buildup)]); config(['teardown_end' => is_null($teardown) ? null : new Carbon($teardown)]); $check = new ChecksArrivalsAndDeparturesImplementation(); $this->assertTrue($check->checkArrival($arrival, $departure)); } /** * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::isDepartureDateValid * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::toCarbon * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::isBeforeBuildup * @covers \Engelsystem\Controllers\ChecksArrivalsAndDepartures::isAfterTeardown * @dataProvider validDepartureCombinations */ public function testCheckValidDatesForDeparture( ?string $buildup, ?string $teardown, ?string $arrival, ?string $departure ) { config(['buildup_start' => is_null($buildup) ? null : new Carbon($buildup)]); config(['teardown_end' => is_null($teardown) ? null : new Carbon($teardown)]); $check = new ChecksArrivalsAndDeparturesImplementation(); $this->assertTrue($check->checkDeparture($arrival, $departure)); } public function setUp(): void { parent::setUp(); $this->config = new Config(); $this->app->instance('config', $this->config); $this->app->instance(Config::class, $this->config); } }