Skip to content
Snippets Groups Projects
Commit c3e34676 authored by Vincent Petry's avatar Vincent Petry
Browse files

Improved unit test for "overwrite on move"

Now using a different content to make sure the file was overwritten.
parent af7118aa
No related branches found
No related tags found
No related merge requests found
......@@ -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() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment