Exemplo n.º 1
0
 public function testWriteAndReadFile()
 {
     $path = $this->tmpDir . '/new.txt';
     // Creating new file.
     $this->assertEquals(true, $this->sftp->write($path, 'MyContent'));
     $this->assertEquals('MyContent', $this->sftp->read($path));
     // Overwriting.
     $this->assertEquals(true, $this->sftp->write($path, 'AnotherContent'));
     $this->assertEquals('AnotherContent', $this->sftp->read($path));
 }
Exemplo n.º 2
0
 /**
  * @param \Ssh\Sftp $sftp
  */
 function it_should_write_file($sftp)
 {
     $sftp->write('/home/l3l0/filename', 'some content')->shouldBeCalled()->willReturn(12);
     $this->write('filename', 'some content')->shouldReturn(12);
 }
Exemplo n.º 3
0
 /**
  * @param \Ssh\Sftp $sftp
  */
 function it_writes_file($sftp)
 {
     $sftp->getUrl('/home/l3l0')->willReturn('ssh+ssl://localhost/home/l3l0');
     $sftp->write('/home/l3l0/filename', 'some content')->shouldBeCalled()->willReturn(12);
     $this->write('filename', 'some content')->shouldReturn(12);
 }