Neos\Flow\ResourceManagement\Streams\StreamWrapperAdapter::rename PHP Метод

rename() публичный Метод

This method is called in response to rename(). Should attempt to rename path_from to path_to. Note: In order for the appropriate error message to be returned this method should not be defined if the wrapper does not support creating directories.
public rename ( string $path_from, string $path_to ) : boolean
$path_from string The URL to the current file.
$path_to string The URL which the path_from should be renamed to.
Результат boolean TRUE on success or FALSE on failure.
    public function rename($path_from, $path_to)
    {
        $this->createStreamWrapper($path_from);
        return $this->streamWrapper->rename($path_from, $path_to);
    }

Usage Example

 /**
  * @test
  */
 public function renameTest()
 {
     $fromPath = 'mockScheme1://foo/bar';
     $toPath = 'mockScheme1://foo/baz';
     $this->streamWrapperAdapter->expects($this->once())->method('createStreamWrapper')->with($fromPath);
     $this->mockStreamWrapper->expects($this->once())->method('rename')->with($fromPath, $toPath)->will($this->returnValue(true));
     $this->assertTrue($this->streamWrapperAdapter->rename($fromPath, $toPath));
 }