Example #1
0
 public function testTestExistingFile()
 {
     $path = $this->tmpDir . '/foo.txt';
     $this->assertTrue($this->sftp->exists($path));
     $list = $this->sftp->listDirectory($this->tmpDir);
     $this->assertContains($path, $list['files']);
 }
Example #2
0
 /**
  * @param \Ssh\Sftp $sftp
  */
 function it_should_get_keys($sftp)
 {
     $sftp->listDirectory('/home/l3l0', true)->willReturn(array('files' => array('/home/l3l0/filename', '/home/l3l0/filename1', '/home/l3l0/aaa/filename')));
     $this->keys()->shouldReturn(array('aaa', 'aaa/filename', 'filename', 'filename1'));
 }
Example #3
0
 /**
  * @param \Ssh\Sftp $sftp
  */
 function it_fetches_keys($sftp)
 {
     $sftp->getUrl('/home/l3l0')->willReturn('ssh+ssl://localhost/home/l3l0');
     $sftp->listDirectory('/home/l3l0', true)->willReturn(array('files' => array('/home/l3l0/filename', '/home/l3l0/filename1', '/home/l3l0/aaa/filename')));
     $this->keys()->shouldReturn(array('aaa', 'aaa/filename', 'filename', 'filename1'));
 }