}
function putContents($content)
{
$fp = @fopen($this->filename, 'wb');
$write = @fwrite($fp, $content);
@fclose($fp);
return !($write === false);
}
function append($content)
{
$fp = @fopen($this->filename, 'ab');
$append = @fwrite($fp, $content);
@fclose($fp);
return !($append === false);
}
function delete()
{
return @unlink($this->filename);
}
}
?>
单元测试类 fileTest.php
//include_once '../simpletest/unit_tester.php';
文章来源于领测软件测试网 https://www.ltesting.net/