/** * testAuthenticateThrowsUnexpectedValueExceptionForInvalidAuthenticationResult * * @covers ArpAuth\Authentication\Adapter\AdapterChain::authenticate * @test */ public function testAuthenticateThrowsUnexpectedValueExceptionForInvalidAuthenticationResult() { $identity = 'alex.patterson'; $credential = 'Password123'; $this->setExpectedException(UnexpectedValueException::class); $adapterChain = new AdapterChain([]); $adapterChain->setIdentity($identity); $adapterChain->setCredential($credential); $chainableAdapter = $this->createChainableAdapterMock('test'); $chainableAdapter->expects($this->once())->method('setIdentity')->with($identity); $chainableAdapter->expects($this->once())->method('setCredential')->with($credential); $chainableAdapter->expects($this->once())->method('authenticate')->will($this->returnValue(false)); $adapterChain->addAdapter($chainableAdapter); $adapterChain->authenticate(); }