Exemplo n.º 1
0
 public function testRenameFile()
 {
     $path = $this->tmpDir . '/bar/bob.txt';
     $pathTarget = $this->tmpDir . '/bar/bob.txt_moved';
     $this->assertTrue(is_array($this->sftp->stat($path)));
     $this->assertFalse($this->sftp->stat($pathTarget));
     $this->assertTrue($this->sftp->rename($path, $pathTarget));
     $this->assertTrue(is_array($this->sftp->stat($pathTarget)));
     $this->assertFalse($this->sftp->stat($path));
 }
Exemplo n.º 2
0
 /**
  * @param \Ssh\Sftp $sftp
  */
 function it_should_rename_file($sftp)
 {
     $sftp->rename('/home/l3l0/filename', '/home/l3l0/filename1')->shouldBeCalled()->willReturn(true);
     $this->rename('filename', 'filename1')->shouldReturn(true);
 }
Exemplo n.º 3
0
 /**
  * @param \Ssh\Sftp $sftp
  */
 function it_renames_file($sftp)
 {
     $sftp->getUrl('/home/l3l0')->willReturn('ssh+ssl://localhost/home/l3l0');
     $sftp->rename('/home/l3l0/filename', '/home/l3l0/filename1')->shouldBeCalled()->willReturn(true);
     $this->rename('filename', 'filename1')->shouldReturn(true);
 }