Home >Backend Development >PHP Tutorial >PHP 测试对象库:Samsui

PHP 测试对象库:Samsui

WBOY
WBOYOriginal
2016-06-23 13:30:261114browse

Samsui 是一个用于建立对构建你的应用程序测试数据有用的 PHP 对象库。通过 Samsui,你可以快速建立原型应用,产生你测试原型所需要的数据。

示例代码:

use Samsui\Factory; $factory = new Factory(); // define an object quickly$factory->define('person')    ->sequence('personId')    ->attr('firstName', 'James')    ->attr('lastName', 'Clark')    ->attr('email', function ($i, $o) {        return strtolower($o->firstName . '.' . $o->lastName . '@example.com');    })    ->attr('createdTime', function () {        return time();    });

项目主页:http://www.open-open.com/lib/view/home/1437393938271

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php文件下载Next article:php socket数据等待,php卡死