/**
  * @covers ZfcUser\Authentication\Adapter\AdapterChain::authenticate
  */
 public function testAuthenticate()
 {
     $event = $this->getMock('ZfcUser\\Authentication\\Adapter\\AdapterChainEvent');
     $event->expects($this->once())->method('getCode')->will($this->returnValue(123));
     $event->expects($this->once())->method('getIdentity')->will($this->returnValue('identity'));
     $event->expects($this->once())->method('getMessages')->will($this->returnValue(array()));
     $this->eventManager->expects($this->once())->method('getListeners')->with($this->equalTo('authenticate'))->will($this->returnValue(array()));
     $this->adapterChain->setEvent($event);
     $result = $this->adapterChain->authenticate();
     $this->assertInstanceOf('Zend\\Authentication\\Result', $result);
     $this->assertEquals($result->getIdentity(), 'identity');
     $this->assertEquals($result->getMessages(), array());
 }