File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
spec/Configuration/Parser Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 33 "description" : " Manage Supervisor configuration in PHP" ,
44 "license" : " MIT" ,
55 "keywords" : [" supervisor" , " configuration" ],
6- "homepage" : " https://indigophp .com" ,
6+ "homepage" : " https://supervisorphp .com" ,
77 "authors" : [
88 {
99 "name" : " Márk Sági-Kazár" ,
Original file line number Diff line number Diff line change @@ -41,4 +41,11 @@ function it_throws_an_exception_when_invalid_file_given(Flysystem $filesystem)
4141
4242 $ this ->shouldThrow ('Supervisor\Exception\ParsingFailed ' )->duringParse ();
4343 }
44+
45+ function it_throws_an_exception_when_cannot_read_file_given (Flysystem $ filesystem )
46+ {
47+ $ filesystem ->read ('supervisord.conf ' )->willReturn (false );
48+
49+ $ this ->shouldThrow ('Supervisor\Exception\ParsingFailed ' )->duringParse ();
50+ }
4451}
Original file line number Diff line number Diff line change @@ -47,7 +47,9 @@ public function parse(Configuration $configuration = null)
4747 throw new ParsingFailed (sprintf ('File "%s" not found ' , $ this ->file ));
4848 }
4949
50- $ fileContents = $ this ->filesystem ->read ($ this ->file );
50+ if (!$ fileContents = $ this ->filesystem ->read ($ this ->file )) {
51+ throw new ParsingFailed (sprintf ('Reading file "%s" failed ' , $ this ->file ));
52+ }
5153
5254 $ parser = new Text ($ fileContents );
5355
You can’t perform that action at this time.
0 commit comments