/** * @param \Ssh\Sftp $sftp */ function it_should_check_if_file_exists($sftp) { $sftp->getUrl('/home/l3l0')->willReturn('ssh+ssl://localhost/home/l3l0'); $sftp->getUrl('/home/l3l0/filename')->shouldBeCalled()->willReturn('ssh+ssl://localhost/home/l3l0/filename'); $sftp->getUrl('/home/l3l0/filename1')->shouldBeCalled()->willReturn('ssh+ssl://localhost/home/l3l0/filename1'); $this->exists('filename')->shouldReturn(true); $this->exists('filename1')->shouldReturn(false); }
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']); }