本文整理汇总了PHP中Magento\Framework\Filesystem\Directory\Write::createSymlink方法的典型用法代码示例。如果您正苦于以下问题:PHP Write::createSymlink方法的具体用法?PHP Write::createSymlink怎么用?PHP Write::createSymlink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Filesystem\Directory\Write
的用法示例。
在下文中一共展示了Write::createSymlink方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreateSymlinkTargetDirectoryExists
public function testCreateSymlinkTargetDirectoryExists()
{
$targetDir = $this->getMockBuilder('Magento\\Framework\\Filesystem\\Directory\\WriteInterface')->getMock();
$targetDir->driver = $this->driver;
$sourcePath = 'source/path/file';
$destinationDirectory = 'destination/path';
$destinationFile = $destinationDirectory . '/' . 'file';
$this->assertIsFileExpectation($sourcePath);
$this->driver->expects($this->once())->method('getParentDirectory')->with($destinationFile)->willReturn($destinationDirectory);
$targetDir->expects($this->once())->method('isExist')->with($destinationDirectory)->willReturn(true);
$targetDir->expects($this->once())->method('getAbsolutePath')->with($destinationFile)->willReturn($this->getAbsolutePath($destinationFile));
$this->driver->expects($this->once())->method('symlink')->with($this->getAbsolutePath($sourcePath), $this->getAbsolutePath($destinationFile), $targetDir->driver)->willReturn(true);
$this->assertTrue($this->write->createSymlink($sourcePath, $destinationFile, $targetDir));
}