diff --git a/tests/event/event-form-handler.php b/tests/event/event-form-handler.php index f154f3c2..790ea7f1 100644 --- a/tests/event/event-form-handler.php +++ b/tests/event/event-form-handler.php @@ -20,6 +20,7 @@ public function setUp(): void { $this->event_repository = new Event_Repository( $this->now, $this->attendee_repository ); $this->event_form_handler = new Event_Form_Handler( $this->now, $this->event_repository ); $this->event_form_handler_factory = new Event_Form_Handler_Factory(); + $this->set_normal_user_as_current(); } /** @@ -34,4 +35,11 @@ public function test_user_is_not_logged_in() { $this->assertEquals( 'The user must be logged in.', $response->get_error_message() ); } + + public function test_form_name_is_invalid() { + $form_data = $this->event_form_handler_factory->future_inactive_event_form_data( 'invalid_form_name', $this->now ); + $response = $this->event_form_handler->process_form( $form_data ); + + $this->assertEquals( 'Invalid form name.', $response->get_error_message() ); + } }