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 * @dataProvider invalidDateCombinations */ public function testCheckInvalidDatesForDeparture($buildup, $teardown, $arrival, $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 * @dataProvider validDateCombinations */ public function testCheckValidDatesForArrival($buildup, $teardown, $arrival, $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 * @dataProvider validDateCombinations */ public function testCheckValidDatesForDeparture($buildup, $teardown, $arrival, $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); } }