PHP 单元测试框架 Testify

码农软件 · 软件分类 · 单元测试工具 · 2019-11-18 13:41:57

软件介绍

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

代码示例:

require 'vendor/autoload.php';

use Math\MyCalc;
use Testify\Testify;$tf = new Testify("MyCalc Test Suite");$tf->beforeEach(function($tf) {
    $tf->data->calc = new MyCalc(10);});$tf->test("Testing the add() method", function($tf) {
    $calc = $tf->data->calc;

    $calc->add(4);
    $tf->assert($calc->result() == 14);

    $calc->add(-6);
    $tf->assertEquals($calc->result(), 8);});$tf->test("Testing the mul() method", function($tf) {
    $calc = $tf->data->calc;

    $calc->mul(1.5);
    $tf->assertEquals($calc->result(), 12);

    $calc->mul(-1);
    $tf->assertEquals($calc->result(), -12);});$tf();

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

A Common-Sense Guide to Data Structures and Algorithms

A Common-Sense Guide to Data Structures and Algorithms

Jay Wengrow / Pragmatic Bookshelf / 2017-8-13 / USD 45.95

If you last saw algorithms in a university course or at a job interview, you’re missing out on what they can do for your code. Learn different sorting and searching techniques, and when to use each. F......一起来看看 《A Common-Sense Guide to Data Structures and Algorithms》 这本书的介绍吧!

html转js在线工具
html转js在线工具

html转js在线工具

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

正则表达式在线测试

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具