File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,23 @@ public function testParseFromFile()
6868 $ this ->assertSame ('adhocore/json-comment ' , $ parsed ['name ' ]);
6969 }
7070
71+ public function testParseFromFileThrowsNotExists ()
72+ {
73+ $ this ->expectException (\RuntimeException::class);
74+ $ this ->expectExceptionMessage ('File does-not-exist.json does not exist ' );
75+
76+ Comment::parseFromFile ('does-not-exist.json ' , true );
77+ }
78+
79+ public function testParseFromFileThrowsNotFile ()
80+ {
81+ $ this ->expectException (\RuntimeException::class);
82+ $ this ->expectExceptionMessage (__DIR__ . ' is not a file ' );
83+
84+ Comment::parseFromFile (__DIR__ , true );
85+ }
86+
87+
7188 public function testSubJson ()
7289 {
7390 // https://github.com/adhocore/php-json-comment/issues/15
You can’t perform that action at this time.
0 commit comments