浏览代码

Test to check there is a RuntimeException thrown when a path repository doesn't exist

Mike van Rooyen 5 年之前
父节点
当前提交
e62478ab89
共有 1 个文件被更改,包括 18 次插入0 次删除
  1. 18 0
      tests/Composer/Test/Repository/PathRepositoryTest.php

+ 18 - 0
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')