facebook/fbexpect
最新稳定版本:v2.9.1
Composer 安装命令:
composer require facebook/fbexpect
包简介
Unit test helpers for Facebook projects
README 文档
README
FBExpect
FBExpect is a standalone unit testing utility based on the notion of assertions from PHPUnit. Starting with 2.x, FBExpect no longer uses PHPUnit as a
dependency, and instead implements the assertions directly, and is intentended
for use with HackTest.
Examples
Clarity
It is linguistically clear which value is the expected value and which is the actual value:
use function Facebook\FBExpect\expect; // PHPUnit $this->assertSame($a, $b); // FBExpect expect($b)->toBeSame($a);
Type Refinement
use function Facebook\FBExpect\expect; // PHPUnit $this->assertNotNull($x); // Actual test assert($x !== null); // Tell the typechecker what's going on $this->assertInstanceOf(Foo::class, $y); assert($y instanceof Foo); // FBExpect $x = expect($x)->toNotBeNull(); $y = expect($y)->toBeInstanceOf(Foo::class);
Installation
FBExpect is installed via composer:
composer require facebook/fbexpect
Composer must be executed with php, not HHVM.
License
FBExpect is MIT-licensed.
统计信息
- 总下载量: 1.08M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 1
- 依赖项目数: 73
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-01