public function testRename()
{
$filePath0 = CFile::createTemporary();
$newName = CFilePath::name($filePath0) . "-renamed";
$filePath1 = CFilePath::add(CFilePath::directory($filePath0), $newName);
CFile::write($filePath0, "Hello there!");
CFile::rename($filePath0, $newName);
$this->assertTrue(!CFile::exists($filePath0) && CFile::exists($filePath1) && CFile::read($filePath1)->equals("Hello there!"));
CFile::delete($filePath1);
}