{
$contents = 'content';
$this->assertTrue($this->file->putContents($contents));
$this->assertEqual($this->file->getContents(), $contents);
}
function testAppend()
{
$this->file->putContents('SimpleTest');
$this->assertTrue($this->file->append('NeverMind'));
$this->assertWantedPattern('~nevermind$~i', $this->file->getContents());
}
function testDelete()
{
$this->assertTrue($this->file->delete());
$this->assertFalse(file_exists($this->filename));
}
}
$test = new fileTest('test.txt');
$test->run(new HtmlReporter());
?>
文章来源于领测软件测试网 https://www.ltesting.net/