File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ class VersionFinder
2020
2121 public function __construct (array $ paths )
2222 {
23+ if (empty ($ paths )) {
24+ throw new \RuntimeException (
25+ 'No paths were provided to the version finder. '
26+ );
27+ }
2328 $ this ->paths = $ paths ;
2429 }
2530
Original file line number Diff line number Diff line change @@ -35,4 +35,16 @@ public function testGetCollection()
3535 $ versions = $ collection ->getAllVersions ();
3636 $ this ->assertCount (3 , $ versions );
3737 }
38+
39+ /**
40+ * It should do nothing if no migrations paths are given.
41+ *
42+ * @expectedException \RuntimeException
43+ * @expectedExceptionMessage No paths were provided
44+ */
45+ public function testNoMigrationPaths ()
46+ {
47+ $ collection = (new VersionFinder (array ()))->getCollection ();
48+ $ versions = $ collection ->getAllVersions ();
49+ }
3850}
You can’t perform that action at this time.
0 commit comments