Add integration tests for The Events Calendar #31

Merged
linos merged 17 commits from improve_tests into main 2024-09-24 16:24:32 +02:00
2 changed files with 11 additions and 4 deletions
Showing only changes of commit cc3b8e4a91 - Show all commits

View file

@ -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';

View file

@ -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' ));
}
}