summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-11-25 18:54:58 +0100
committerVincent Petry <pvince81@owncloud.com>2013-11-25 18:54:58 +0100
commitc3e34676ba0a5467cadc1fd931ed659262705388 (patch)
tree5ea95ebf9ab6c01945324e64735cad15e14eac91 /tests
parentaf7118aa5db19165bcded3c860b3163488d7b6f6 (diff)
downloadnextcloud-server-c3e34676ba0a5467cadc1fd931ed659262705388.tar.gz
nextcloud-server-c3e34676ba0a5467cadc1fd931ed659262705388.zip
Improved unit test for "overwrite on move"
Now using a different content to make sure the file was overwritten.
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/storage/storage.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php
index be534635ec9..c627395945e 100644
--- a/tests/lib/files/storage/storage.php
+++ b/tests/lib/files/storage/storage.php
@@ -142,10 +142,12 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target2.txt'));
// move to overwrite
- $this->instance->rename('/target2.txt', '/target.txt');
- $this->assertTrue($this->instance->file_exists('/target.txt'));
+ $testContents = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ $this->instance->file_put_contents('/target3.txt', $testContents);
+ $this->instance->rename('/target2.txt', '/target3.txt');
+ $this->assertTrue($this->instance->file_exists('/target3.txt'));
$this->assertFalse($this->instance->file_exists('/target2.txt'));
- $this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target.txt'));
+ $this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target3.txt'));
}
public function testLocal() {