public function testGetMergeOfPathsIntoSingleField()
 {
     $paths = array('realname' => array('first_name', 'last_name'));
     $this->responseObject->setPaths($paths);
     $this->responseObject->setResponse(array('first_name' => 'foo', 'last_name' => 'bar'));
     $this->assertEquals('foo bar', $this->responseObject->getRealName());
     $this->responseObject->setResponse(array('first_name' => null, 'last_name' => 'bar'));
     $this->assertEquals('bar', $this->responseObject->getRealName());
 }
 /**
  * @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationException
  */
 public function testNoIdentifierPath()
 {
     // easy path
     $paths = array('non_username' => 'non_existing');
     $this->responseObject->setPaths($paths);
     $this->responseObject->setResponse(json_encode(array('foo' => 'bar')));
     // should throw exception
     $this->responseObject->getNickname();
 }