From e62478ab896115d5014e0f5eba6e571c723b789e Mon Sep 17 00:00:00 2001 From: Mike van Rooyen Date: Tue, 8 Oct 2019 15:48:04 +0100 Subject: [PATCH] Test to check there is a RuntimeException thrown when a path repository doesn't exist --- .../Test/Repository/PathRepositoryTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/Composer/Test/Repository/PathRepositoryTest.php b/tests/Composer/Test/Repository/PathRepositoryTest.php index a9594257c..fde704066 100644 --- a/tests/Composer/Test/Repository/PathRepositoryTest.php +++ b/tests/Composer/Test/Repository/PathRepositoryTest.php @@ -19,6 +19,24 @@ use Composer\Test\TestCase; class PathRepositoryTest extends TestCase { + + /** + * @expectedException RuntimeException + */ + public function testLoadPackageFromFileSystemWithIncorrectPath() + { + $ioInterface = $this->getMockBuilder('Composer\IO\IOInterface') + ->getMock(); + + $config = new \Composer\Config(); + $versionGuesser = null; + + $repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', 'missing')); + $repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config); + $repository->getPackages(); + + } + public function testLoadPackageFromFileSystemWithVersion() { $ioInterface = $this->getMockBuilder('Composer\IO\IOInterface')