예제 #1
0
 public function testWriteStream()
 {
     $dir = \OC::$SERVERROOT . '/tests/data';
     $this->instance = $this->getNew();
     $fh = $this->instance->getStream('lorem.txt', 'w');
     $source = fopen($dir . '/lorem.txt', 'r');
     \OCP\Files::streamCopy($source, $fh);
     fclose($source);
     fclose($fh);
     $this->assertTrue($this->instance->fileExists('lorem.txt'));
     $this->assertEquals(file_get_contents($dir . '/lorem.txt'), $this->instance->getFile('lorem.txt'));
 }