Skip to content

Commit c559be6

Browse files
committed
* Improved docs
1 parent d8505d3 commit c559be6

4 files changed

Lines changed: 112 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 2.0
4+
5+
* Support for Chained Verifiers.
6+
* The Verify API is now fully based on the PHPUnit public API.
7+
* Improved IDE autocompletion depending on the type of data you want to verify
8+
* Simplified data validations.
9+
* Improved code quality, performance and maintainability.
10+
* See **BC** details in the UPGRADE.md file.
11+
312
## 1.5
413

514
* Support for full PHPUnit API `(42 new verifiers!)`

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ With [BDD][3] assertions influenced by [Chai][4], [Jasmine][5], and [RSpec][6] y
1919
composer require codeception/verify --dev
2020
```
2121

22+
> :arrow_up: **Upgrade from 1.x by following [the upgrade guide.][9]**
23+
24+
2225
## Usage
2326

2427
Use in any test `Verify` function instead of `$this->assert*` methods:
@@ -132,3 +135,4 @@ Verify is open-sourced software licensed under the [MIT][8] License.
132135
[6]: http://rspec.info/
133136
[7]: /docs/supported_verifiers.md
134137
[8]: /LICENSE
138+
[9]: /UPGRADE.md

UPGRADE.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
UPGRADE FROM 1.X TO 2.X
2+
=======================
3+
4+
5+
PHP version
6+
------
7+
8+
* Removed support for `PHP 7.1` & `PHP 7.2`.
9+
10+
11+
Verify function
12+
-------
13+
14+
* `Verify` no longer receives a `string $message` as a parameter, now each _**verifier**_ fulfills this function.
15+
* `verify_that` and `verify_not` were deleted. Use `Verify()->notEmpty` and `Verify()->empty` instead.
16+
* `expect_that` and `expect_not` were deleted. Use `Expect()->notEmpty` and `Expect()->empty` instead.
17+
* `expect_file` and `setIsFileExpectation` were deleted. Use `Verify::File()` instead.
18+
19+
Verifiers
20+
-------
21+
22+
| Verify 1.x | Verify 2.x |
23+
|-------------------------------------------------|---------------------------------------------------|
24+
| `verify()->array` | `Verify()->isArray` |
25+
| `verify()->bool` | `Verify()->isBool` |
26+
| `verify()->callable` | `Verify()->isCallable` |
27+
| `verify()->float` | `Verify()->isFloat` |
28+
| `verify()->greaterOrEquals` | `Verify()->greaterThanOrEqual` |
29+
| `verify()->int` | `Verify()->isInt` |
30+
| `verify()->isEmpty` | `Verify()->empty` |
31+
| `verify()->isInstanceOf` | `Verify()->instanceOf` |
32+
| `verify()->isNotInstanceOf` | `Verify()->notInstanceOf` |
33+
| `verify()->lessOrEquals` | `Verify()->lessThanOrEqual` |
34+
| `verify()->notArray` | `Verify()->isNotArray` |
35+
| `verify()->notBool` | `Verify()->isNotBool` |
36+
| `verify()->notCallable` | `Verify()->isNotCallable` |
37+
| `verify()->notFloat` | `Verify()->isNotFloat` |
38+
| `verify()->notInt` | `Verify()->isNotInt` |
39+
| `verify()->notNumeric` | `Verify()->isNotNumeric` |
40+
| `verify()->notObject` | `Verify()->isNotObject` |
41+
| `verify()->notResource` | `Verify()->isNotResource` |
42+
| `verify()->notScalar` | `Verify()->isNotScalar` |
43+
| `verify()->notString` | `Verify()->isNotString` |
44+
| `verify()->numeric` | `Verify()->isNumeric` |
45+
| `verify()->object` | `Verify()->isObject` |
46+
| `verify()->resource` | `Verify()->isResource` |
47+
| `verify()->scalar` | `Verify()->isScalar` |
48+
| `verify()->string` | `Verify()->isString` |
49+
| `verify()->hasAttribute` | `Verify::BaseObject()->hasAttribute` |
50+
| `verify()->notHasAttribute` | `Verify::BaseObject()->notHasAttribute` |
51+
| `verify()->throws` | `Verify::Callable()->throws` |
52+
| `verify()->doesNotThrow` | `Verify::Callable()->doesNotThrow` |
53+
| `verify()->hasStaticAttribute` | `Verify::Class()->hasStaticAttribute` |
54+
| `verify()->notHasStaticAttribute` | `Verify::Class()->notHasStaticAttribute` |
55+
| `verify()->hasAttribute` | `Verify::Class()->hasAttribute` |
56+
| `verify()->notHasAttribute` | `Verify::Class()->notHasAttribute` |
57+
| `verify()->directoryDoesNotExist` | `Verify::Directory()->doesNotExist` |
58+
| `verify()->directoryExists` | `Verify::Directory()->exists` |
59+
| `verify()->directoryIsNotReadable` | `Verify::Directory()->isNotReadable` |
60+
| `verify()->directoryIsNotWritable` | `Verify::Directory()->isNotWritable` |
61+
| `verify()->notExists` | `Verify::File()->doesNotExists` |
62+
| `verify()->fileEqualsCanonicalizing` | `Verify::File()->equalsCanonicalizing` |
63+
| `verify()->fileEqualsIgnoringCase` | `Verify::File()->equalsIgnoringCase` |
64+
| `verify()->fileIsNotReadable` | `Verify::File()->isNotReadable` |
65+
| `verify()->fileIsNotWritable` | `Verify::File()->isNotWritable` |
66+
| `verify()->fileIsReadable` | `Verify::File()->isReadable` |
67+
| `verify()->fileIsWritable` | `Verify::File()->isWritable` |
68+
| `verify()->fileNotEqualsCanonicalizing` | `Verify::File()->notEqualsCanonicalizing` |
69+
| `verify()->fileNotEqualsIgnoringCase` | `Verify::File()->notEqualsIgnoringCase` |
70+
| `verify()->jsonFileNotEqualsJsonFile` | `Verify::JsonFile()->notEqualsJsonFile` |
71+
| `verify()->jsonStringNotEqualsJsonFile` | `Verify::JsonString()->notEqualsJsonFile` |
72+
| `verify()->jsonStringNotEqualsJsonString` | `Verify::JsonString()->otEqualsJsonString` |
73+
| `verify()->regExp` | `Verify::String()->matchesRegExp` |
74+
| `verify()->stringContainsString` | `Verify::String()->containsString` |
75+
| `verify()->stringContainsStringIgnoringCase` | `Verify::String()->containsStringIgnoringCase` |
76+
| `verify()->stringEqualsFileCanonicalizing` | `Verify::String()->equalsFileCanonicalizing` |
77+
| `verify()->stringEqualsFileIgnoringCase` | `Verify::String()->equalsFileIgnoringCase` |
78+
| `verify()->stringNotEqualsFileCanonicalizing` | `Verify::String()->notEqualsFileCanonicalizing` |
79+
| `verify()->stringNotEqualsFileIgnoringCase` | `Verify::String()->notEqualsFileIgnoringCase` |
80+
| `verify()->notRegExp` | `Verify::String()->doesNotMatchRegExp` |
81+
| `verify()->stringNotContainsString` | `Verify::String()->notContainsString` |
82+
| `verify()->stringNotContainsStringIgnoringCase` | `Verify::String()->notContainsStringIgnoringCase` |
83+
| `verify()->notStartsWith` | `Verify::String()->notStartsWith` |
84+
| `verify()->xmlFileNotEqualsXmlFile` | `Verify::XmlFile()->notEqualsXmlFile` |
85+
| `verify()->xmlStringNotEqualsXmlFile` | `Verify::XmlString()->notEqualsXmlFile` |
86+
| `verify()->xmlStringNotEqualsXmlString` | `Verify::XmlString()->notEqualsXmlString` |
87+
88+
89+
Extending
90+
-------
91+
92+
* `Codeception\Verify::$override` was removed, extend from abstract `Codeception\Verify\Verify` class instead.

docs/supported_verifiers.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ notSameSize
1717
sameSize
1818
```
1919

20+
### BaseObject
21+
```
22+
hasAttribute
23+
notHasAttribute
24+
```
25+
2026
### Callable
2127
```
2228
throws
@@ -152,7 +158,7 @@ startsNotWith
152158
startsWith
153159
```
154160

155-
### String
161+
### XmlFile
156162
```
157163
equalsXmlFile
158164
notEqualsXmlFile

0 commit comments

Comments
 (0)