Example #1
0
 public function testUpdateEventRegistrationStatus()
 {
     // Create the Event. (Response 0)
     $event = new Event($this->ews, 'N15RLM');
     // Get availability. (Response 1)
     $registration = $event->createRegistration(1);
     // Execute the API call
     $registration->updateStatus('everything-is-ok');
     // Call update for code coverage and to ensure there are no adverse effects.
     $registration->update();
     // Get the request from the history
     $request = $this->history[2]['request'];
     // Assert that the request is made to the correct endpoint
     $this->assertRequestMethodSame('PATCH', $request);
     $this->assertRequestUriPathSame('api/v2/events/N15RLM/registrations/123/status.json', $request);
     // Assert the body contains the new participant status
     $this->assertRequestBodyParameterSame('status', 'everything-is-ok', $request);
     // Assert that the request uses the OAuth access token to authenticate
     $this->assertRequestAuthenticates(self::ACCESS_TOKEN, $request);
 }