$_REQUEST = [];
}
+ /**
+ * Tests the event dashboard as a minimally permissioned user.
+ */
+ public function testEventDashboard() {
+ CRM_Core_Config::singleton()->userPermissionClass->permissions = [
+ 'register for events',
+ 'access Contact Dashboard',
+ ];
+ $event1id = $this->eventCreate()['id'];
+ $event2id = $this->eventCreate(['title' => 'Social Distancing Meetup Group'])['id'];
+ $params['contact_id'] = $this->contactID;
+ $params['event_id'] = $event1id;
+ $this->participantCreate($params);
+ $params['event_id'] = $event2id;
+ $this->participantCreate($params);
+ $this->runUserDashboard();
+ $expectedStrings = [
+ '<div class="header-dark">Your Event(s)</div>',
+ '<td class="crm-participant-event-id_1"><a href="/index.php?q=civicrm/event/info&reset=1&id=1&context=dashboard">Annual CiviCRM meet</a></td>',
+ '<td class="crm-participant-event-id_2"><a href="/index.php?q=civicrm/event/info&reset=1&id=2&context=dashboard">Social Distancing Meetup Group</a></td>',
+ ];
+ $this->assertPageContains($expectedStrings);
+ $this->individualCreate();
+ }
+
}