A wrapper for PHPUnit which allows expect assertion syntax inspired by JavaScript's Jasmine.
Note: currently incomplete - if I'm missing a matcher you need create an issue or pull request
The preferred way to install this bundle is via Composer. Just add it to your composer.json:
{
"require": {
// ...
"danrspencer/phpunit-expect-syntax": "2.0.0"
}
}
To begin using the syntax you'll need to include the expect-syntax.php file. This can be done in your PHPUnit bootstrap (recommended) or in invididual tests.
e.g.
require_once '../vendor/danrspencer/phpunit-expect-syntax/ExpectSyntax.php';
/** @test */
function it_tests_something() {
expect($this)->toEqual($that);
}