11Verify
22======
33
4- BDD Assertions for PHPUnit and Codeception
4+ BDD Assertions for [ PHPUnit] [ 1 ] and [ Codeception] [ 2 ]
55
66This is very tiny wrapper for PHPUnit assertions, that are aimed to make tests a bit more readable.
7- With BDD assertions influenced by Chai, Jasmine, and RSpec your assertions would be a bit closer to natural language.
7+ With [ BDD] [ 3 ] assertions influenced by [ Chai] [ 4 ] , [ Jasmine] [ 5 ] , and [ RSpec] [ 6 ] your assertions would be a bit closer to natural language.
88
99[ ![ Build Status] ( https://travis-ci.org/Codeception/Verify.png?branch=master )] ( https://travis-ci.org/Codeception/Verify ) [ ![ Latest Stable Version] ( https://poser.pugx.org/codeception/verify/v/stable.png )] ( https://packagist.org/packages/codeception/verify )
1010
11-
12- ``` php
13- <?php
11+ ``` php
1412$user = User::find(1);
1513
1614// equal
@@ -33,7 +31,7 @@ verify($rate)->lessOrEquals(8);
3331verify($rate)->greaterOrEquals(7);
3432verify($rate)->greaterOrEquals(5);
3533
36- // true/ false/ null
34+ // true / false / null
3735verify($user->isAdmin())->true();
3836verify($user->isBanned())->false();
3937verify($user->invitedBy)->null();
@@ -42,42 +40,52 @@ verify($user->getPosts())->notNull();
4240// empty
4341verify($user->getComments())->isEmpty();
4442verify($user->getRoles())->notEmpty();
45- ?>
4643```
4744
4845Shorthands for testing truth/fallacy:
4946
50- ``` php
51- <?php
47+ ``` php
5248verify_that($user->isActivated());
5349verify_not($user->isBanned());
54- ?>
5550```
5651
57- This 2 functions doesn 't check for strict true/false matching, rather ` empty ` function is used.
52+ These two functions don 't check for strict true/false matching, rather ` empty ` function is used.
5853` verify_that ` checks that result is not empty value, ` verify_not ` does the opposite.
5954
6055## Alternative Syntax
6156
62- If you follow TDD/BDD you'd rather use ` expect ` instead of ` verify ` . Which is just an alias functions:
57+ If you follow TDD/BDD you'd rather use ` expect ` instead of ` verify ` . Which are just an alias functions:
6358
64- ``` php
59+ ``` php
6560expect("user have 5 posts", $user->getNumPosts())->equals(5);
6661expect_that($user->isActive());
6762expect_not($user->isBanned());
6863```
6964
70-
7165## Installation
7266
73- With Composer:
67+ ### Installing via Composer
68+
69+ Install composer in a common location or in your project:
7470
71+ ``` sh
72+ curl -s http://getcomposer.org/installer | php
7573```
74+
75+ Create the ` composer.json ` file as follows:
76+
77+ ``` json
7678"require-dev" : {
7779 "codeception/verify" : " ^1.0"
7880}
7981```
8082
83+ Run the composer installer:
84+
85+ ``` sh
86+ php composer.phar install
87+ ```
88+
8189## Usage
8290
8391Use in any test ` verify ` function instead of ` $this->assert* ` methods.
@@ -106,5 +114,14 @@ Set the class name to `Codeception\Verify::override` property to `verify` functi
106114verify('it works')->success();
107115```
108116
117+ ## License
118+
119+ Verify is open-sourced software licensed under the [ MIT] [ 7 ] License. © Codeception PHP Testing Framework
109120
110- ** License: MIT**
121+ [ 1 ] : https://phpunit.de/
122+ [ 2 ] : http://codeception.com/
123+ [ 3 ] : https://en.wikipedia.org/wiki/Behavior-driven_development
124+ [ 4 ] : http://chaijs.com/
125+ [ 5 ] : http://jasmine.github.io/
126+ [ 6 ] : http://rspec.info/
127+ [ 7 ] : https://github.com/Codeception/Verify/blob/master/LICENSE
0 commit comments