/** * @expectedException \PharIo\Phive\DownloadFailedException */ public function testThrowsExceptionIfKeyWasNotFound() { $response = $this->prophesize(CurlResponse::class); $response->getHttpCode()->willReturn(404); $response->getErrorMessage()->willReturn('Not Found'); $this->curl->get(Argument::any(), Argument::any())->willReturn($response); $downloader = new GnupgKeyDownloader($this->curl->reveal(), [new Url('https://example.com')], $this->output->reveal()); $downloader->download('12345678'); }
/** * @return KeyService */ private function getKeyService() { return new KeyService($this->downloader->reveal(), $this->importer->reveal(), $this->output->reveal(), $this->input->reveal()); }
/** * @return PharService */ private function getPharService() { return new PharService($this->downloader->reveal(), $this->installer->reveal(), $this->repository->reveal(), $this->resolver->reveal(), $this->output->reveal(), $this->pharIoRepositoryFactory->reveal()); }