/** * Creates test OAuth client instance. * @return BaseOAuth oauth client. */ protected function createOAuthClient() { $oauthClient = $this->getMock(BaseOAuth::className(), ['setState', 'getState', 'composeRequestCurlOptions', 'refreshAccessToken', 'apiInternal']); $oauthClient->expects($this->any())->method('setState')->will($this->returnValue($oauthClient)); $oauthClient->expects($this->any())->method('getState')->will($this->returnValue(null)); return $oauthClient; }