public function setUp()
{
$request = new Request();
$response = new Response();
$this->Table = TableRegistry::get('CakeDC/Users.Users');
$this->Token = $this->getMockBuilder('League\\OAuth2\\Client\\Token\\AccessToken')->setMethods(['getToken', 'getExpires'])->disableOriginalConstructor()->getMock();
$this->controller = $this->getMockBuilder('Cake\\Controller\\Controller')->setMethods(['failedSocialLogin', 'dispatchEvent'])->setConstructorArgs([$request, $response])->getMock();
$this->controller->expects($this->any())->method('dispatchEvent')->will($this->returnValue(new Event('test')));
$this->Request = $request;
$this->SocialAuthenticate = $this->_getSocialAuthenticateMockMethods(['_authenticate', '_getProviderName', '_mapUser', '_socialLogin', 'dispatchEvent', '_validateConfig', '_getController']);
$this->SocialAuthenticate->expects($this->any())->method('_getController')->will($this->returnValue($this->controller));
}