diff --git a/tests/TestCase/Shell/PluginAssetsShellTest.php b/tests/TestCase/Shell/PluginAssetsShellTest.php index 8ddf505227c..f1e5a301692 100644 --- a/tests/TestCase/Shell/PluginAssetsShellTest.php +++ b/tests/TestCase/Shell/PluginAssetsShellTest.php @@ -100,6 +100,27 @@ public function testSymlinkWhenVendorDirectoryExits() { $folder->delete(); } +/** + * testSymlinkWhenTargetAlreadyExits + * + * @return void + */ + public function testSymlinkWhenTargetAlreadyExits() { + Plugin::load('TestTheme'); + + $shell = $this->getMock( + 'Cake\Shell\PluginAssetsShell', + array('in', 'out', 'err', '_stop', '_createSymlink', '_copyDirectory'), + array($this->io) + ); + + $this->assertTrue(is_dir(WWW_ROOT . 'test_theme')); + + $shell->expects($this->never())->method('_createSymlink'); + $shell->expects($this->never())->method('_copyDirectory'); + $shell->symlink(); + } + /** * test that plugins without webroot are not processed *