@@ -198,7 +198,7 @@ public function testBrokenSymlinkDetectionOnExistingFile(): void
198198 /**
199199 * Tests Installer::checkForBrokenSymlinks
200200 */
201- public function testBrokenSymlinkDetectionOnBrokenSymlink (): void
201+ public function testBrokenSymlinkDetectionOnBrokenAbsoluteSymlink (): void
202202 {
203203 $ this ->expectException (Exception::class);
204204
@@ -213,7 +213,30 @@ public function testBrokenSymlinkDetectionOnBrokenSymlink(): void
213213
214214 $ runner = new FakeInstaller ($ io , $ config , $ repo , $ template );
215215 $ file ->method ('isLink ' )->willReturn (true );
216- $ file ->method ('linkTarget ' )->willReturn ('./foo/bar/baz ' );
216+ $ file ->method ('linkTarget ' )->willReturn ('/foo/bar/baz ' );
217+
218+ $ runner ->checkSymlink ($ file );
219+ }
220+
221+ /**
222+ * Tests Installer::checkForBrokenSymlinks
223+ */
224+ public function testBrokenSymlinkDetectionOnBrokenRelativeSymlink (): void
225+ {
226+ $ this ->expectException (Exception::class);
227+
228+ $ io = $ this ->createIOMock ();
229+ $ config = $ this ->createConfigMock ();
230+ $ repo = $ this ->createRepositoryMock ();
231+ $ template = $ this ->createTemplateMock ();
232+
233+ $ file = $ this ->getMockBuilder (File::class)
234+ ->disableOriginalConstructor ()
235+ ->getMock ();
236+
237+ $ runner = new FakeInstaller ($ io , $ config , $ repo , $ template );
238+ $ file ->method ('isLink ' )->willReturn (true );
239+ $ file ->method ('linkTarget ' )->willReturn ('../../foo/bar/baz ' );
217240
218241 $ runner ->checkSymlink ($ file );
219242 }
0 commit comments