[Pkg-owncloud-commits] [owncloud] 131/239: Improved unit test for "overwrite on move"

David Prévot taffit at moszumanska.debian.org
Fri Nov 29 01:32:28 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit c3e34676ba0a5467cadc1fd931ed659262705388
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Mon Nov 25 18:54:58 2013 +0100

    Improved unit test for "overwrite on move"
    
    Now using a different content to make sure the file was overwritten.
---
 tests/lib/files/storage/storage.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php
index be53463..c627395 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() {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list