diff --git a/tests/bootstrap.php b/tests/bootstrap.php index c5bd5d3..c8397d0 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -30,7 +30,7 @@ require_once "{$_tests_dir}/includes/functions.php"; */ function _manually_load_plugin() { require dirname( __DIR__ ) . '/activitypub-event-extensions.php'; - $event_plugin = getenv( 'WP_EVENT_PLUGIN' ); + $event_plugin = 'the-events-calendar'; switch ( $event_plugin ) { case 'the-events-calendar': require ABSPATH . '/wp-content/mu-plugins/the-events-calendar/the-events-calendar.php'; diff --git a/tests/test-class-sample.php b/tests/test-class-sample.php index a0a2e39..0adab4f 100644 --- a/tests/test-class-sample.php +++ b/tests/test-class-sample.php @@ -22,8 +22,15 @@ class Test_Sample extends WP_UnitTestCase { * Tesd tes */ public function test_the_events_calendar() { - // Replace this with some actual testing code. - $class_exists = class_exists( 'Tribe__Events__Main' ); - $this->assertTrue( $class_exists ); + // First check manually that The Events Calendar is loaded. + $class = class_exists( '\Tribe__Events__Main' ); + $this->assertTrue( $class ); + + // Get instance of our plugin. + $aec = \Activitypub_Event_Extensions\Setup::get_instance(); + $this->assertContains( 'the-events-calendar', $aec->get_active_event_plugins() ); + + $aec->activate_activitypub_support_for_active_event_plugins(); + $this->assertContains( 'tribe_events', get_option( 'activitypub_support_post_types' )); } }