//include_once '../simpletest/reporter.php';
include_once('../simpletest/autorun.php');
include_once 'file.class.php';
class fileTest extends UnitTestCase
{
var $file;
var $filename;
function fileTest($filename)
{
$this->filename = $filename;
$this->file = new File($this->filename);
$this->UnitTestCase('File Manipulation Test');
}
/**
* 描述:该函数将会在每次测试开始前自动调用,
* 在编写测试类的时候,是个可选函数,可写不可不写
*/
function setUp()
{
$fp = @fopen($this->filename, 'x');
if (!($fp == false)) {
fwrite($fp, '');
fclose($fp);
}
文章来源于领测软件测试网 https://www.ltesting.net/