public function testRequestAccessToken() { // Execute the API call EWSClient::requestAccessToken($this->httpClient, 'my_client_id', 'my_client_secret'); // Test the constructor fully new EWSClient($this->httpClient, 'my_client_id', 'my_client_secret'); // Get the request from the history $request = $this->history[1]['request']; // Assert that the request is made to the correct endpoint $this->assertRequestMethodSame('GET', $request); $this->assertRequestUriPathSame('oauth/v2/token', $request); // Assert that the query parameters are correct $this->assertRequestQueryParameterSame('client_id', 'my_client_id', $request); $this->assertRequestQueryParameterSame('client_secret', 'my_client_secret', $request); // Test getting and setting accessToken $this->ews = new EWSClient($this->httpClient, self::ACCESS_TOKEN); $access_token = 'token'; $this->ews->setAccessToken($access_token); $this->assertSame($access_token, $this->ews->getAccessToken()); // Test getting and setting the path $this->ews = new EWSClient($this->httpClient, self::ACCESS_TOKEN); $path = 'path'; $this->ews->setPath($path); $this->assertSame($path, $this->ews->getPath()); }