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

PHP 测试对象库:Samsui

WBOY
Release: 2016-06-23 13:30:26
Original
1118 people have browsed it

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();    });
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template