Testify PHP 单元测试框架开源项目

我要开发同款
匿名用户2014年09月03日
73阅读

技术信息

开源地址
https://github.com/marco-fiset/Testify.php
授权协议
GPL

作品详情

Testify(Testify.php)是个极小的PHP5.3+单元测试框架。

代码示例:

require 'vedor/autoload.php';use Math\MyCalc;use Testify\Testify;$tf = ew Testify("MyCalc Test Suite");$tf->beforeEach(fuctio($tf) {    $tf->data->calc = ew MyCalc(10);});$tf->test("Testig the add() method", fuctio($tf) {    $calc = $tf->data->calc;    $calc->add(4);    $tf->assert($calc->result() == 14);    $calc->add(-6);    $tf->assertEquals($calc->result(), 8);});$tf->test("Testig the mul() method", fuctio($tf) {    $calc = $tf->data->calc;    $calc->mul(1.5);    $tf->assertEquals($calc->result(), 12);    $calc->mul(-1);    $tf->assertEquals($calc->result(), -12);});$tf();

功能介绍

Testify(Testify.php) 是个极小的 PHP 5.3+ 单元测试框架。 代码示例: require 'vendor/autoload.php';

use Math\MyCalc...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论