SimpleTest首页、文档和下载 - PHP单元测试框架 - 开源中国

SimpleTest 是一个为PHP程序提供的单元测试的框架,包含一个内嵌的web浏览器用来测试PHP的Web网站。

示例代码

 <?php
require_once('simpletest/unit_tester.php');
require_once('simpletest/reporter.php');
require_once('../classes/log.php');

class TestOfLogging extends UnitTestCase {

function testCreatingNewFile() {
@unlink('/temp/test.log');
$log = new Log('/temp/test.log');
$this->assertFalse(file_exists('/temp/test.log'));
$log->message('Should write this to a file');
$this->assertTrue(file_exists('/temp/test.log'));
}
}
**
$test = &new TestOfLogging();
$test->run(new HtmlReporter());**
?>


Original url: Access
Created at: 2019-02-19 15:20:35
Category: default
Tags: none

请先后发表评论
  • 最新评论
  • 总共0条评论