PHP单元测试框架 SimpleTest

码农软件 · 软件分类 · 单元测试工具 · 2019-11-20 09:56:45

软件介绍

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

?>

本文地址:https://codercto.com/soft/d/19388.html

REST in Practice

REST in Practice

Jim Webber、Savas Parastatidis、Ian Robinson / O'Reilly Media / 2010-9-24 / USD 44.99

Why don't typical enterprise projects go as smoothly as projects you develop for the Web? Does the REST architectural style really present a viable alternative for building distributed systems and ent......一起来看看 《REST in Practice》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试