public function testSearchesEvent() { $response_body = ['results' => [['eventCode' => 123, 'eventName' => 'Banana']]]; $this->responses = [new Response(200, [], json_encode($response_body))]; // History that's going to be populated by the HTTP Client. $this->history = []; // Create httpClient $this->httpClient = $this->getHttpClient($this->history, $this->responses); $this->ews = new EWSClient($this->httpClient, self::ACCESS_TOKEN); $events = Event::searches($this->ews, [[]]); $this->assertEquals($events[0]->asArray(), $response_body['results'][0]); }