add basic venue support and tests for eventprime
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 52s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Successful in 1m8s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Successful in 1m4s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m6s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m12s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m9s
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 52s
PHPUnit / PHPUnit – PHP 7.4 (pull_request) Successful in 1m8s
PHPUnit / PHPUnit – PHP 8.0 (pull_request) Successful in 1m4s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m6s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 1m12s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 1m9s
This commit is contained in:
parent
81ea0be874
commit
aa353c3795
3 changed files with 41 additions and 4 deletions
|
@ -109,3 +109,8 @@ jobs:
|
|||
run: cd /workspace/Event-Federation/wordpress-activitypub-event-bridge/ && ./vendor/bin/phpunit --filter=modern_events_calendar_lite
|
||||
env:
|
||||
PHP_VERSION: ${{ matrix.php-version }}
|
||||
|
||||
- name: Run Integration tests for EventPrime
|
||||
run: cd /workspace/Event-Federation/wordpress-activitypub-event-bridge/ && ./vendor/bin/phpunit --filter=eventprime
|
||||
env:
|
||||
PHP_VERSION: ${{ matrix.php-version }}
|
|
@ -54,11 +54,12 @@
|
|||
"@test-events-manager",
|
||||
"@test-wp-event-manager",
|
||||
"@test-eventin",
|
||||
"@test-modern-events-calendar-lite"
|
||||
"@test-modern-events-calendar-lite",
|
||||
"@test-eventprime"
|
||||
],
|
||||
"test-debug": [
|
||||
"@prepare-test",
|
||||
"@test-gatherpress"
|
||||
"@test-eventprime"
|
||||
],
|
||||
"test-vs-event-list": "phpunit --filter=vs_event_list",
|
||||
"test-the-events-calendar": "phpunit --filter=the_events_calendar",
|
||||
|
@ -67,6 +68,7 @@
|
|||
"test-wp-event-manager": "phpunit --filter=wp_event_manager",
|
||||
"test-eventin": "phpunit --filter=eventin",
|
||||
"test-modern-events-calendar-lite": "phpunit --filter=modern_events_calendar_lite",
|
||||
"test-eventprime": "phpunit --filter=eventprime",
|
||||
"test-all": "phpunit"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,10 +11,8 @@ namespace ActivityPub_Event_Bridge\Activitypub\Transformer;
|
|||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
|
||||
|
||||
use Activitypub\Activity\Extended_Object\Event as Event_Object;
|
||||
use Activitypub\Activity\Extended_Object\Place;
|
||||
use ActivityPub_Event_Bridge\Activitypub\Transformer\Event;
|
||||
use GatherPress\Core\Event as GatherPress_Event;
|
||||
|
||||
/**
|
||||
* ActivityPub Transformer for VS Event
|
||||
|
@ -45,4 +43,36 @@ final class EventPrime extends Event {
|
|||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get location from the event object.
|
||||
*/
|
||||
protected function get_location(): ?Place {
|
||||
$venue_term_id = get_post_meta( $this->wp_object->ID, 'em_venue', true );
|
||||
if ( ! $venue_term_id ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$venue = wp_get_post_terms( $this->wp_object->ID, 'em_venue' );
|
||||
|
||||
if ( empty( $venue ) ) {
|
||||
return null;
|
||||
} else {
|
||||
$venue = $venue[0];
|
||||
}
|
||||
|
||||
$place = new Place();
|
||||
|
||||
$place->set_name( $venue->name );
|
||||
$place->set_content( $venue->description );
|
||||
|
||||
$address = get_term_meta( $venue->term_id, 'em_address', true );
|
||||
$display_address = get_term_meta( $venue->term_id, 'em_display_address_on_frontend', true );
|
||||
|
||||
if ( $address && $display_address ) {
|
||||
$place->set_address( get_term_meta( $venue->term_id, 'em_address', true ) );
|
||||
}
|
||||
|
||||
return $place;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue