123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace Composer\Test\Mock;
- use Composer\Util\RemoteFilesystem;
- use Composer\Downloader\TransportException;
- class RemoteFilesystemMock extends RemoteFilesystem
- {
-
- public function __construct(array $contentMap)
- {
- $this->contentMap = $contentMap;
- }
- public function getContents($originUrl, $fileUrl, $progress = true, $options = array())
- {
- if (!empty($this->contentMap[$fileUrl])) {
- return $this->contentMap[$fileUrl];
- }
- throw new TransportException('The "'.$fileUrl.'" file could not be downloaded (NOT FOUND)', 404);
- }
- }
|