File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 22
33namespace Tooly \Tests \Script \Helper ;
44
5+ use Composer \Util \Platform ;
56use org \bovigo \vfs \vfsStream ;
67use phpmock \phpunit \PHPMock ;
78use Tooly \Script \Helper \Filesystem ;
@@ -42,6 +43,10 @@ public function tearDown()
4243
4344 public function testCanRelativeSymlinkAFile ()
4445 {
46+ if (Platform::isWindows ()) {
47+ $ this ->markTestSkipped ('Symlink not possible on Windows. ' );
48+ }
49+
4550 $ symlink = $ this ->testDirectory . DIRECTORY_SEPARATOR . '/foo/symlinkOrCopy ' ;
4651
4752 $ this ->assertTrue ($ this ->filesystem ->symlinkFile ($ this ->testFile , $ symlink ));
Original file line number Diff line number Diff line change 33namespace Tooly \Tests \Script \Processor ;
44
55use Composer \IO \ConsoleIO ;
6+ use Composer \Util \Platform ;
67use Tooly \Factory \ToolFactory ;
78use Tooly \Script \Configuration ;
89use Tooly \Script \Helper ;
@@ -38,7 +39,7 @@ public function setUp()
3839 ->getMock ();
3940 }
4041
41- public function testCanCreateASymlink ()
42+ public function testCanCreateASymlinkOrCopy ()
4243 {
4344 $ this ->configuration
4445 ->expects ($ this ->once ())
@@ -49,9 +50,15 @@ public function testCanCreateASymlink()
4950 ->getMockBuilder (Filesystem::class)
5051 ->getMock ();
5152
52- $ filesystem
53- ->expects ($ this ->once ())
54- ->method ('symlinkFile ' );
53+ if (Platform::isWindows ()) {
54+ $ filesystem
55+ ->expects ($ this ->once ())
56+ ->method ('copyFile ' );
57+ } else {
58+ $ filesystem
59+ ->expects ($ this ->once ())
60+ ->method ('symlinkFile ' );
61+ }
5562
5663 $ this ->helper
5764 ->expects ($ this ->once ())
You can’t perform that action at this time.
0 commit comments