Skip to content

danrspencer/phpunit-expect-syntax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phpunit-expect-syntax

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

Installation

Step 1. Install via Composer

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"
    }
}

Step 2. Include the expect-syntax.php file

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';

Example usage

/** @test */
function it_tests_something() {
	expect($this)->toEqual($that);	
}

About

A wrapper for PHPUnit which allows expect assertion syntax

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages