/** * @expectedException \Datto\JsonRpc\Exception\MissingAuth */ public function testAuthorizingRequestWithNoValidHandler() { $handlerMock = $this->getMock('\\Datto\\JsonRpc\\Auth\\Handler'); $handlerMock->expects($this->once())->method('canHandle')->willReturn(false); $handlerMock->expects($this->never())->method('authenticate'); $auth = new Authenticator(); $auth->addHandler($handlerMock); $auth->authenticate("", array()); }