function ResourceStreamTestCase::testCopyRenameUnlink in D7 Media 6
File
- resource/
tests/ ResourceStream.test, line 116 - This provides SimpleTests for the core stream wrapper functionality.
Class
- ResourceStreamTestCase
- Base class for file tests that adds some additional file specific assertions and helper functions.
Code
function testCopyRenameUnlink() {
copy($this->scheme . $this->path, $this->scheme . $this->path . '.2');
$this
->assertTrue(file_exists($this->scheme . $this->path . '.2'), "Copy successful");
unlink($this->scheme . $this->path);
$this
->assertFalse(file_exists($this->scheme . $this->path), "Unlink successful");
rename($this->scheme . $this->path . '.2', $this->scheme . $this->path);
$this
->assertTrue(file_exists($this->scheme . $this->path), "Rename successful");
}