Added unit test for "overwrite file on rename/move"

Also fixed "rename" unit test that was ready the result out of the wrong
file.
This commit is contained in:
Vincent Petry 2013-11-25 18:52:14 +01:00
parent 1b0c5e57e5
commit af7118aa5d
1 changed files with 6 additions and 0 deletions

View File

@ -139,6 +139,12 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this->instance->rename('/source.txt', '/target2.txt');
$this->assertTrue($this->instance->file_exists('/target2.txt'));
$this->assertFalse($this->instance->file_exists('/source.txt'));
$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'));
$this->assertFalse($this->instance->file_exists('/target2.txt'));
$this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target.txt'));
}