File tree 1 file changed +13
-1
lines changed 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace ADR \Filesystem ;
4
4
5
+ use org \bovigo \vfs \vfsStream ;
5
6
use RuntimeException ;
6
7
use PHPUnit \Framework \TestCase ;
7
8
@@ -15,11 +16,22 @@ public function testInstanceSuccessfully()
15
16
$ this ->assertEquals ('template/skeleton.md ' , $ config ->decisionRecordTemplateFile ());
16
17
}
17
18
18
- public function testInstanceFailure ()
19
+ public function testInstanceNotExistingFailure ()
19
20
{
20
21
$ this ->expectException (RuntimeException::class);
21
22
$ this ->expectExceptionMessage ('The config file does not exist: invalid.yml ' );
22
23
23
24
new Config ('invalid.yml ' );
24
25
}
26
+
27
+ public function testInstanceNotReadableFailure ()
28
+ {
29
+ $ vfs = vfsStream::setup ();
30
+ $ configFile = vfsStream::newFile ('adr.yml ' )->at ($ vfs )->chmod (0 )->url ();
31
+
32
+ $ this ->expectException (RuntimeException::class);
33
+ $ this ->expectExceptionMessage ("The config file isn't readable: $ configFile " );
34
+
35
+ new Config ($ configFile );
36
+ }
25
37
}
You can’t perform that action at this time.
0 commit comments