public function testGetUserAuth($rawData, $mapper)
{
$user = $this->Table->get('00000000-0000-0000-0000-000000000002', ['contain' => ['SocialAccounts']]);
$this->controller->expects($this->once())->method('dispatchEvent')->with(UsersAuthComponent::EVENT_AFTER_REGISTER, compact('user'));
$this->SocialAuthenticate->expects($this->once())->method('_authenticate')->with($this->Request)->will($this->returnValue($rawData));
$this->SocialAuthenticate->expects($this->once())->method('_getProviderName')->will($this->returnValue('facebook'));
$this->SocialAuthenticate->expects($this->once())->method('_mapUser')->will($this->returnValue($mapper));
$this->SocialAuthenticate->expects($this->once())->method('_socialLogin')->will($this->returnValue($user));
$result = $this->SocialAuthenticate->getUser($this->Request);
$this->assertTrue($result['active']);
$this->assertEquals('00000000-0000-0000-0000-000000000002', $result['id']);
}