phpcs
All checks were successful
PHP Code Checker / PHP Code Checker (pull_request) Successful in 42s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Successful in 1m0s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Successful in 1m1s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 57s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 58s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m0s

This commit is contained in:
André Menrath 2024-11-28 21:58:11 +01:00
parent 8f179ff9f3
commit 6a09f6acef

View file

@ -41,10 +41,10 @@ class Test_Event_Organiser extends WP_UnitTestCase {
$this->assertContains( 'event', get_option( 'activitypub_support_post_types' ) ); $this->assertContains( 'event', get_option( 'activitypub_support_post_types' ) );
$event_data = array( $event_data = array(
'start' => new DateTime( '+10 days 15:00:00', eo_get_blog_timezone() ), 'start' => new DateTime( '+10 days 15:00:00', eo_get_blog_timezone() ),
'end' => new DateTime( '+10 days 16:00:00', eo_get_blog_timezone() ), 'end' => new DateTime( '+10 days 16:00:00', eo_get_blog_timezone() ),
'all_day' => 0, 'all_day' => 0,
'schedule' => 'once', 'schedule' => 'once',
); );
$post_data = array( $post_data = array(
@ -67,10 +67,10 @@ class Test_Event_Organiser extends WP_UnitTestCase {
public function test_transform_of_basic_event() { public function test_transform_of_basic_event() {
// Mock Event. // Mock Event.
$event_data = array( $event_data = array(
'start' => new DateTime( '+10 days 15:00:00', eo_get_blog_timezone() ), 'start' => new DateTime( '+10 days 15:00:00', eo_get_blog_timezone() ),
'end' => new DateTime( '+10 days 16:00:00', eo_get_blog_timezone() ), 'end' => new DateTime( '+10 days 16:00:00', eo_get_blog_timezone() ),
'all_day' => 0, 'all_day' => 0,
'schedule' => 'once', 'schedule' => 'once',
); );
$post_data = array( $post_data = array(
@ -81,7 +81,7 @@ class Test_Event_Organiser extends WP_UnitTestCase {
$post_id = eo_insert_event( $post_data, $event_data ); $post_id = eo_insert_event( $post_data, $event_data );
// Call the transformer Factory. // Call the transformer Factory.
$event_array = \Activitypub\Transformer\Factory::get_transformer( get_post( $post_id ) )->to_object()->to_array(); $event_array = \Activitypub\Transformer\Factory::get_transformer( get_post( $post_id ) )->to_object()->to_array();
// Check that the event ActivityStreams representation contains everything as expected. // Check that the event ActivityStreams representation contains everything as expected.
$this->assertEquals( 'Event', $event_array['type'] ); $this->assertEquals( 'Event', $event_array['type'] );