File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,10 @@ public function process(Tool $tool)
9393 */
9494 public function symlink (Tool $ tool )
9595 {
96+ if (true === $ tool ->isOnlyDev () && false === $ this ->configuration ->isDevMode ()) {
97+ return ;
98+ }
99+
96100 $ filename = $ tool ->getFilename ();
97101 $ composerDir = $ this ->configuration ->getComposerBinDirectory ();
98102 $ composerPath = $ composerDir . DIRECTORY_SEPARATOR . basename ($ filename );
Original file line number Diff line number Diff line change @@ -63,4 +63,21 @@ public function testCanCreateASymlink()
6363 $ processor = new Processor ($ this ->io , $ this ->helper , $ this ->configuration );
6464 $ processor ->symlink ($ tool );
6565 }
66+
67+ public function testNoSymlinkCreatedIfOnlyDevToolInNoDevMode ()
68+ {
69+ $ this ->configuration
70+ ->expects ($ this ->once ())
71+ ->method ('isDevMode ' )
72+ ->willReturn (false );
73+
74+ $ this ->helper
75+ ->expects ($ this ->never ())
76+ ->method ('getFilesystem ' );
77+
78+ $ tool = ToolFactory::createTool ('tool ' , __DIR__ , []);
79+
80+ $ processor = new Processor ($ this ->io , $ this ->helper , $ this ->configuration );
81+ $ processor ->symlink ($ tool );
82+ }
6683}
You can’t perform that action at this time.
0 commit comments