SimpleTest PHP单元测试框架

程序名称:SimpleTest

授权协议: LGPL

操作系统: 跨平台

开发语言: PHP

SimpleTest 介绍

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());**  
?>

SimpleTest 官网

http://www.lastcraft.com/simple_test.php

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐