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']); }
/** * @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')); }
/** * @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')); }