|
@@ 447-459 (lines=13) @@
|
| 444 |
|
$this->moveBetweenStorages($storage1, $storage2); |
| 445 |
|
} |
| 446 |
|
|
| 447 |
|
function moveBetweenStorages($storage1, $storage2) { |
| 448 |
|
\OC\Files\Filesystem::mount($storage1, array(), '/'); |
| 449 |
|
\OC\Files\Filesystem::mount($storage2, array(), '/substorage'); |
| 450 |
|
|
| 451 |
|
$rootView = new \OC\Files\View(''); |
| 452 |
|
$rootView->rename('foo.txt', 'substorage/folder/foo.txt'); |
| 453 |
|
$this->assertFalse($rootView->file_exists('foo.txt')); |
| 454 |
|
$this->assertTrue($rootView->file_exists('substorage/folder/foo.txt')); |
| 455 |
|
$rootView->rename('substorage/folder', 'anotherfolder'); |
| 456 |
|
$this->assertFalse($rootView->is_dir('substorage/folder')); |
| 457 |
|
$this->assertTrue($rootView->file_exists('anotherfolder/foo.txt')); |
| 458 |
|
$this->assertTrue($rootView->file_exists('anotherfolder/bar.txt')); |
| 459 |
|
} |
| 460 |
|
|
| 461 |
|
/** |
| 462 |
|
* @medium |
|
@@ 487-501 (lines=15) @@
|
| 484 |
|
/** |
| 485 |
|
* @medium |
| 486 |
|
*/ |
| 487 |
|
public function testUnlinkRootMustFail() { |
| 488 |
|
$storage1 = $this->getTestStorage(); |
| 489 |
|
$storage2 = $this->getTestStorage(); |
| 490 |
|
\OC\Files\Filesystem::mount($storage1, array(), '/'); |
| 491 |
|
\OC\Files\Filesystem::mount($storage2, array(), '/substorage'); |
| 492 |
|
|
| 493 |
|
$rootView = new \OC\Files\View(''); |
| 494 |
|
$rootView->file_put_contents('/foo.txt', 'asd'); |
| 495 |
|
$rootView->file_put_contents('/substorage/bar.txt', 'asd'); |
| 496 |
|
|
| 497 |
|
$this->assertFalse($rootView->unlink('')); |
| 498 |
|
$this->assertFalse($rootView->unlink('/')); |
| 499 |
|
$this->assertFalse($rootView->unlink('substorage')); |
| 500 |
|
$this->assertFalse($rootView->unlink('/substorage')); |
| 501 |
|
} |
| 502 |
|
|
| 503 |
|
/** |
| 504 |
|
* @medium |