Compare commits

..

No commits in common. "e981827e0a10a7724f37510264befa0048f625ba" and "6a09f6acef1b339d0412b1a3a6856a39dbba3250" have entirely different histories.

3 changed files with 6 additions and 30 deletions

View file

@ -20,39 +20,18 @@ use ActivityPub_Event_Bridge\Activitypub\Transformer\Event;
* @since 1.0.0
*/
final class Event_Organiser extends Event {
/**
* Extended constructor.
*
* The wp_object is overridden with a the wp_object with filters. This object
* also contains attributes specific to the Event organiser plugin like the
* occurrence id.
*
* @param WP_Post $wp_object The WordPress object.
* @param string $wp_taxonomy The taxonomy slug of the event post type.
*/
public function __construct( $wp_object, $wp_taxonomy ) {
parent::__construct( $wp_object, $wp_taxonomy );
$this->wp_object = get_posts(
array(
'ID' => $wp_object->ID,
'post_type' => 'event',
'suppress_filters' => false,
)
)[0];
}
/**
* Get the end time from the event object.
*/
protected function get_end_time(): ?string {
return eo_get_the_end( 'Y-m-d\TH:i:s\Z', $this->wp_object->ID, $this->wp_object->occurrence_id );
return eo_get_the_end( 'Y-m-d\TH:i:s\Z', $this->wp_object->ID );
}
/**
* Get the end time from the event object.
*/
protected function get_start_time(): string {
return eo_get_the_start( 'Y-m-d\TH:i:s\Z', $this->wp_object->ID, $this->wp_object->occurrence_id );
return eo_get_the_start( 'Y-m-d\TH:i:s\Z', $this->wp_object->ID );
}
/**

View file

@ -74,7 +74,7 @@ function _manually_load_plugin() {
case 'eventprime':
$plugin_file = 'eventprime-event-calendar-management/event-prime.php';
break;
case 'event_organiser':
case 'event-organiser':
$plugin_file = 'event-organiser/event-organiser.php';
break;
}
@ -103,9 +103,9 @@ function _manually_load_plugin() {
$mec_factory->install();
}
if ( 'event_organiser' === $activitypub_event_bridge_integration_filter ) {
if ( 'event-organiser' === $activitypub_event_bridge_integration_filter ) {
require_once $plugin_dir . 'event-organiser/includes/event-organiser-install.php';
// eventorganiser_install();
eventorganiser_install();
}
// At last manually load our WordPress plugin.

View file

@ -15,7 +15,7 @@ class Test_Event_Organiser extends WP_UnitTestCase {
public function set_up() {
parent::set_up();
if ( ! function_exists( 'eo_get_events' ) ) {
if ( ! class_exists( '\EO_Query_Result' ) ) {
self::markTestSkipped( 'Event Organiser plugin is not active.' );
}
@ -50,7 +50,6 @@ class Test_Event_Organiser extends WP_UnitTestCase {
$post_data = array(
'post_title' => 'Unit Test Event',
'post_content' => 'Unit Test description.',
'post_status' => 'publish',
);
$post_id = eo_insert_event( $post_data, $event_data );
@ -60,7 +59,6 @@ class Test_Event_Organiser extends WP_UnitTestCase {
// Check that we got the right transformer.
$this->assertInstanceOf( \ActivityPub_Event_Bridge\Activitypub\Transformer\Event_Organiser::class, $transformer );
}
/**
@ -78,7 +76,6 @@ class Test_Event_Organiser extends WP_UnitTestCase {
$post_data = array(
'post_title' => 'Unit Test Event',
'post_content' => 'Unit Test description.',
'post_status' => 'publish',
);
$post_id = eo_insert_event( $post_data, $event_data );