@@ -198,7 +198,7 @@ public function testBrokenSymlinkDetectionOnExistingFile(): void
198
198
/**
199
199
* Tests Installer::checkForBrokenSymlinks
200
200
*/
201
- public function testBrokenSymlinkDetectionOnBrokenSymlink (): void
201
+ public function testBrokenSymlinkDetectionOnBrokenAbsoluteSymlink (): void
202
202
{
203
203
$ this ->expectException (Exception::class);
204
204
@@ -213,7 +213,30 @@ public function testBrokenSymlinkDetectionOnBrokenSymlink(): void
213
213
214
214
$ runner = new FakeInstaller ($ io , $ config , $ repo , $ template );
215
215
$ 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 ' );
217
240
218
241
$ runner ->checkSymlink ($ file );
219
242
}
0 commit comments