Improved unit test for "overwrite on move"
Now using a different content to make sure the file was overwritten.
This commit is contained in:
parent
af7118aa5d
commit
c3e34676ba
|
@ -142,10 +142,12 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
|
||||||
$this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target2.txt'));
|
$this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target2.txt'));
|
||||||
|
|
||||||
// move to overwrite
|
// move to overwrite
|
||||||
$this->instance->rename('/target2.txt', '/target.txt');
|
$testContents = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||||
$this->assertTrue($this->instance->file_exists('/target.txt'));
|
$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->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() {
|
public function testLocal() {
|
||||||
|
|
Loading…
Reference in New Issue