kcmerrill / phpwebunit
该软件包最新版本(dev-master)没有可用的许可信息。
一个类似于visual的simpletest测试,简单易用!
dev-master
2013-04-24 22:27 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-28 14:46:23 UTC
README
喜欢TDD?喜欢PHPUnit?喜欢SimpleTest的简洁性?我也是 .. 这是一个简单的包装工具,可以让您在浏览器中使用phpunit,具有与simpletest相同的视觉提示。一个简单的绿色条或红色条(带有phpunit输出)显示问题。
这里有一个描述其使用的youtube视频: http://www.youtube.com/watch?v=an5ZjEVTg0g
其使用也非常简单,根据自动加载,您可以将每个测试的代码行数减少到两行。
首选方法:使用具有实时预览功能的IDE。
设置基本路径,例如: http://test.example.com/phpwebunit/index.php/ <-- 您需要创建此路径。在index.php中,应有类似以下代码:
$sot = __DIR__ . '/../../' . implode('/', $test);
if(file_exists($sot)){
new \kcmerrill\tdd\phpwebunit('', array('bin'=>'/usr/local/php5/bin/phpunit'), array('SCRIPT_FILENAME'=>$sot));
}
另一种方法
//This will test the current php file
require_once __FILE__. '/phpwebunit';
new kcmerrill\tdd\phpwebunit;
//This will test the current php's directory
require_once __FILE__. '/phpwebunit';
new kcmerrill\tdd\phpwebunit(__DIR__);