@@ -81,7 +81,33 @@ public function testConfigEmptyFilesSolution(): void
8181 $ this ->assertStringContainsString ('.meta/config.json: `files.solution` key is empty ' , $ display );
8282 }
8383
84- public function testConfigInvalidFilesSolutionValue (): void
84+ public function testConfigInvalidFilesValueNotArray (): void
85+ {
86+ $ this ->expectException (RuntimeException::class);
87+ $ this ->expectExceptionMessageMatches ('#^\.meta/config\.json: missing or invalid `files\.solution` key$# ' );
88+ $ input = new InMemoryFilesystemAdapter ();
89+ $ inputFs = new Filesystem ($ input );
90+ $ inputFs ->write ('.meta/config.json ' , '{"files":true} ' );
91+ $ output = new InMemoryFilesystemAdapter ();
92+
93+ $ application = new Application ();
94+ $ application ->represent ($ inputFs , new Filesystem ($ output ), new NullLogger ());
95+ }
96+
97+ public function testConfigInvalidFilesMissingSolution (): void
98+ {
99+ $ this ->expectException (RuntimeException::class);
100+ $ this ->expectExceptionMessageMatches ('#^\.meta/config\.json: missing or invalid `files\.solution` key$# ' );
101+ $ input = new InMemoryFilesystemAdapter ();
102+ $ inputFs = new Filesystem ($ input );
103+ $ inputFs ->write ('.meta/config.json ' , '{"files":{}} ' );
104+ $ output = new InMemoryFilesystemAdapter ();
105+
106+ $ application = new Application ();
107+ $ application ->represent ($ inputFs , new Filesystem ($ output ), new NullLogger ());
108+ }
109+
110+ public function testConfigInvalidFilesSolutionValueNotArray (): void
85111 {
86112 $ this ->expectException (RuntimeException::class);
87113 $ this ->expectExceptionMessageMatches ('#^\.meta/config\.json: missing or invalid `files\.solution` key$# ' );
@@ -94,6 +120,19 @@ public function testConfigInvalidFilesSolutionValue(): void
94120 $ application ->represent ($ inputFs , new Filesystem ($ output ), new NullLogger ());
95121 }
96122
123+ public function testConfigInvalidFilesSolutionValueNotArrayOfString (): void
124+ {
125+ $ this ->expectException (RuntimeException::class);
126+ $ this ->expectExceptionMessageMatches ('#^\.meta/config\.json: missing or invalid `files\.solution` key$# ' );
127+ $ input = new InMemoryFilesystemAdapter ();
128+ $ inputFs = new Filesystem ($ input );
129+ $ inputFs ->write ('.meta/config.json ' , '{"files":{"solution":[true]}} ' );
130+ $ output = new InMemoryFilesystemAdapter ();
131+
132+ $ application = new Application ();
133+ $ application ->represent ($ inputFs , new Filesystem ($ output ), new NullLogger ());
134+ }
135+
97136 public function testConfigMissingFilesSolution (): void
98137 {
99138 $ this ->expectException (RuntimeException::class);
0 commit comments