File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ class VersionFinder
20
20
21
21
public function __construct (array $ paths )
22
22
{
23
+ if (empty ($ paths )) {
24
+ throw new \RuntimeException (
25
+ 'No paths were provided to the version finder. '
26
+ );
27
+ }
23
28
$ this ->paths = $ paths ;
24
29
}
25
30
Original file line number Diff line number Diff line change @@ -35,4 +35,16 @@ public function testGetCollection()
35
35
$ versions = $ collection ->getAllVersions ();
36
36
$ this ->assertCount (3 , $ versions );
37
37
}
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
+ }
38
50
}
You can’t perform that action at this time.
0 commit comments