public function testThrowsInvalidJson() { $this->setExpectedException(EWSClientError::class); $this->responses = [new Response(200, [], 'asdlfkjdslfj{}[]')]; // Create httpClient $this->httpClient = $this->getHttpClient($this->history, $this->responses); $this->ews = new EWSClient($this->httpClient, self::ACCESS_TOKEN); Event::search($this->ews, []); }