thumbtack/jafar

该软件包已被废弃,不再维护。未建议替代软件包。

PHP 的行为驱动测试。类似于 Jasmine。

dev-master 2014-06-03 23:49 UTC

This package is not auto-updated.

Last update: 2023-09-30 10:19:07 UTC


README

Jafar 是 PHP 的行为测试工具包,类似于 JavaScript 中的 Jasmine

使用方法

<?php

require_once 'jafar.php';

describe('Exception', function() {
    it('has a message', function() {
        $message = 'Oops!';
        expect(new \Exception($message)->getMessage())->toBe($message);
    });

    it('can be thrown', function() {
        expect('RuntimeException')->toBeThrownFrom(function() {
            throw new RuntimeException();
        });
    });
});

许可证

Jafar 在 3 条 BSD 许可证的条款下分发。请参阅 COPYING