Example #1
0
 function testRange()
 {
     $file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
     $file->put('0000000');
     $file->putRange('111', 3);
     $this->assertEquals('0011100', file_get_contents(SABRE_TEMPDIR . '/file.txt'));
 }
Example #2
0
 function testPut()
 {
     $file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
     $result = $file->put('New contents');
     $this->assertEquals('New contents', file_get_contents(SABRE_TEMPDIR . '/file.txt'));
     $this->assertEquals('"' . md5('New contents') . '"', $result);
 }
Example #3
0
 function testRangeStream()
 {
     $stream = fopen('php://memory', 'r+');
     fwrite($stream, "222");
     rewind($stream);
     $file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
     $file->put('0000000');
     $file->putRange($stream, 3);
     $this->assertEquals('0022200', file_get_contents(SABRE_TEMPDIR . '/file.txt'));
 }