diff --git a/includes/controller/event_config_controller.php b/includes/controller/event_config_controller.php index a18b6f42..e64f47fd 100644 --- a/includes/controller/event_config_controller.php +++ b/includes/controller/event_config_controller.php @@ -28,7 +28,7 @@ function event_config_edit_controller() $teardown_end_date = null; $event_config = EventConfig(); - if (empty($event_config)) { + if (!empty($event_config)) { $event_name = $event_config['event_name']; $buildup_start_date = $event_config['buildup_start_date']; $event_start_date = $event_config['event_start_date']; diff --git a/includes/sys_page.php b/includes/sys_page.php index 355a915f..55fb3b38 100644 --- a/includes/sys_page.php +++ b/includes/sys_page.php @@ -42,9 +42,10 @@ function check_request_datetime($date_name, $time_name, $allowed_days, $default_ function parse_date($pattern, $value) { $datetime = DateTime::createFromFormat($pattern, trim($value)); - if (is_null($datetime)) { + if (!$datetime) { return null; } + return $datetime->getTimestamp(); } diff --git a/tests/Feature/Model/RoomModelTest.php b/tests/Feature/Model/RoomModelTest.php index 4edb20c3..22aa4b8e 100644 --- a/tests/Feature/Model/RoomModelTest.php +++ b/tests/Feature/Model/RoomModelTest.php @@ -24,11 +24,11 @@ class RoomModelTest extends TestCase $room = Room($this->room_id); - $this->assertNotFalse($room); + $this->assertNotEmpty($room); $this->assertNotNull($room); $this->assertEquals($room['Name'], 'test'); - $this->assertNull(Room(-1)); + $this->assertEmpty(Room(-1)); } public function tearDown()