Skip to content

Commit

Permalink
Add event form handler factory
Browse files Browse the repository at this point in the history
  • Loading branch information
trymebytes committed Dec 9, 2024
1 parent c9e213d commit 35bc39d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/lib/event-form-handler-factory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Wporg\TranslationEvents\Tests;

use DateTimeImmutable;
use DateTimeZone;

class Event_Form_Handler_Factory {

public function future_inactive_event_form_data( $form_name, DateTimeImmutable $now, $event_id = 0 ): array {
$timezone = new DateTimeZone( 'Europe/Lisbon' );
$event_title = 'Foo title';
$event_description = 'Foo description';
$event_attendance_mode = 'hybrid';
$_event_id = isset( $event_id ) ? $event_id : 0;

return array(
'action' => 'submit_event_ajax',
'form_name' => $form_name,
'event_id' => $_event_id,
'event_form_action' => 'publish',
'event_title' => $event_title,
'event_description' => $event_description,
'event_start' => $now->modify( '+1 month' ),
'event_end' => $now->modify( '+2 month' ),
'event_timezone' => $timezone,
'event_attendance_mode' => $event_attendance_mode,
);

}

Check failure on line 30 in tests/lib/event-form-handler-factory.php

View workflow job for this annotation

GitHub Actions / phpcs

Function closing brace must go on the next line following the body; found 1 blank lines before brace
}

0 comments on commit 35bc39d

Please sign in to comment.