Skip to content

Commit

Permalink
Test for invalid form name
Browse files Browse the repository at this point in the history
  • Loading branch information
trymebytes committed Dec 11, 2024
1 parent 4343121 commit ca4b5a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/event/event-form-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand All @@ -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() );
}
}

0 comments on commit ca4b5a6

Please sign in to comment.