Skip to content

Commit 11fa56c

Browse files
author
Gustavo Nieves
authored
Verify 2.1.0
* Added new expect-toBe and expect-notTo BDD Syntax. * Added full documentation about Expectations. * Fixed minor bugs. * Deleted RoboFile and VERSION file. * BC: `expect` function now works with expectations instead of verifiers.
2 parents 66b075b + 2b2972a commit 11fa56c

31 files changed

Lines changed: 2667 additions & 144 deletions

CHANGELOG.md

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

3+
## 2.1
4+
5+
* Added new expect-toBe and expect-notTo BDD Syntax.
6+
* Added full documentation about Expectations.
7+
* Fixed minor bugs.
8+
* Deleted RoboFile and VERSION file.
9+
* **BC:** `expect` function now works with expectations instead of verifiers.
10+
311
## 2.0
412

513
* Support for Chained Verifiers.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013-2015 Codeception PHP Testing Framework
3+
Copyright (c) 2013-2020 Codeception PHP Testing Framework
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ With [BDD][3] assertions influenced by [Chai][4], [Jasmine][5], and [RSpec][6] y
2121
composer require codeception/verify --dev
2222
```
2323

24-
> :arrow_up: **Upgrade from 1.x by following [the upgrade guide.][9]**
24+
> :arrow_up: **Upgrade from 1.x by following [the upgrade guide.][10]**
2525
2626

2727
## Usage
@@ -83,11 +83,19 @@ Verify::Callable($callback)
8383
8484
## Alternative Syntax
8585

86-
If you follow TDD/BDD you'd rather use `expect` or `verify_that` instead of `verify`. Which are just an alias function:
86+
If you follow TDD/BDD you'd rather use `expect` instead of `verify`:
8787

8888
```php
89-
expect($user->getNumPosts())->equals(5, 'user have 5 posts');
89+
expect($user->getNumPosts())
90+
->notToBeNull()
91+
->toBeInt()
92+
->toEqual(5, 'user have 5 posts');
93+
```
94+
> :page_facing_up: **See Expectations full list [here.][8]**
95+
>
96+
Or `verify_that` which is just an alias function:
9097

98+
```php
9199
verify_that($user->getRate())->equals(7, 'first user rate is 7');
92100
```
93101

@@ -117,7 +125,7 @@ class MyVerify extends Verify {
117125
```
118126

119127
And use it!
120-
128+
121129
```php
122130
$myVerify = new MyVerify;
123131

@@ -128,7 +136,7 @@ $myVerify::Mixed('this also')->notEquals('works');
128136

129137
## License
130138

131-
Verify is open-sourced software licensed under the [MIT][8] License.
139+
Verify is open-sourced software licensed under the [MIT][9] License.
132140
© Codeception PHP Testing Framework
133141

134142
[1]: https://phpunit.de/
@@ -138,5 +146,6 @@ Verify is open-sourced software licensed under the [MIT][8] License.
138146
[5]: http://jasmine.github.io/
139147
[6]: http://rspec.info/
140148
[7]: /docs/supported_verifiers.md
141-
[8]: /LICENSE
142-
[9]: /UPGRADE.md
149+
[8]: /docs/supported_expectations.md
150+
[9]: /LICENSE
151+
[10]: /UPGRADE.md

RoboFile.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/supported_expectations.md

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
## Expectations List
2+
3+
`expect()` supports all the expectations listed here! :rocket:
4+
5+
### Array
6+
```
7+
notToContain
8+
notToContainEqual
9+
notToContainOnly
10+
notToHaveCount
11+
notToHaveKey
12+
notToHaveSameSizeAs
13+
toContain
14+
toContainEqual
15+
toContainOnly
16+
toContainOnlyInstancesOf
17+
toHaveCount
18+
toHaveKey
19+
toHaveSameSizeAs
20+
```
21+
22+
### BaseObject
23+
```
24+
notToHaveAttribute
25+
toHaveAttribute
26+
```
27+
28+
### Callable
29+
```
30+
notToThrow
31+
toThrow
32+
```
33+
34+
### Class
35+
```
36+
notToHaveAttribute
37+
notToHaveStaticAttribute
38+
toHaveAttribute
39+
toHaveStaticAttribute
40+
```
41+
42+
### Directory
43+
```
44+
notToBeReadable
45+
notToBeWritable
46+
notToExist
47+
toBeReadable
48+
toBeWritable
49+
toExist
50+
toExistAndNotToBeReadable
51+
toExistAndNotToBeWritable
52+
toExistAndToBeReadable
53+
toExistAndToBeWritable
54+
```
55+
56+
### File
57+
```
58+
notToBeReadable
59+
notToBeWritable
60+
notToExist
61+
toBeEqual
62+
toBeEqualCanonicalizing
63+
toBeEqualIgnoringCase
64+
toBeReadable
65+
toBeWritable
66+
toExist
67+
toExistAndNotToBeReadable
68+
toExistAndNotToBeWritable
69+
toExistAndToBeReadable
70+
toExistAndToBeWritable
71+
toNotEqual
72+
toNotEqualCanonicalizing
73+
toNotEqualIgnoringCase
74+
```
75+
76+
### JsonFile
77+
```
78+
notToEqualJsonFile
79+
toEqualJsonFile
80+
```
81+
82+
### JsonString
83+
```
84+
notToEqualJsonFile
85+
notToEqualJsonString
86+
toEqualJsonFile
87+
toEqualJsonString
88+
```
89+
90+
### Mixed
91+
```
92+
notToBe
93+
notToBeArray
94+
notToBeBool
95+
notToBeCallable
96+
notToBeClosedResource
97+
notToBeEmpty
98+
notToBeFalse
99+
notToBeFloat
100+
notToBeInstanceOf
101+
notToBeInt
102+
notToBeIterable
103+
notToBeNull
104+
notToBeNumeric
105+
notToBeObject
106+
notToBeResource
107+
notToBeScalar
108+
notToBeString
109+
notToBeTrue
110+
notToEqual
111+
notToEqualCanonicalizing
112+
notToEqualIgnoringCase
113+
notToEqualWithDelta
114+
toBe
115+
toBeArray
116+
toBeBool
117+
toBeCallable
118+
toBeClosedResource
119+
toBeEmpty
120+
toBeFalse
121+
toBeFinite
122+
toBeFloat
123+
toBeGreaterThan
124+
toBeGreaterThanOrEqualTo
125+
toBeInfinite
126+
toBeInstanceOf
127+
toBeInt
128+
toBeIterable
129+
toBeLessThan
130+
toBeLessThanOrEqualTo
131+
toBeNan
132+
toBeNull
133+
toBeNumeric
134+
toBeObject
135+
toBeResource
136+
toBeScalar
137+
toBeString
138+
toBeTrue
139+
toEqual
140+
toEqualCanonicalizing
141+
toEqualIgnoringCase
142+
toEqualWithDelta
143+
```
144+
145+
### String
146+
```
147+
notToContainString
148+
notToContainStringIgnoringCase
149+
notToEndWith
150+
notToEqualFile
151+
notToEqualFileCanonicalizing
152+
notToEqualFileIgnoringCase
153+
notToMatchFormat
154+
notToMatchFormatFile
155+
notToMatchRegExp
156+
notToStartWith
157+
toBeJson
158+
toContainString
159+
toContainStringIgnoringCase
160+
toEndWith
161+
toEqualFile
162+
toEqualFileCanonicalizing
163+
toEqualFileIgnoringCase
164+
toMatchFormat
165+
toMatchFormatFile
166+
toMatchRegExp
167+
toStartWith
168+
```
169+
170+
### XmlFile
171+
```
172+
notToEqualXmlFile
173+
toEqualXmlFile
174+
```
175+
176+
### XmlString
177+
```
178+
notToEqualXmlFile
179+
notToEqualXmlString
180+
toEqualXmlFile
181+
toEqualXmlString
182+
```

docs/supported_verifiers.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ notHasStaticAttribute
4343
```
4444
doesNotExist
4545
exists
46+
existsAndIsNotReadable
47+
existsAndIsNotWritable
48+
existsAndIsReadable
49+
existsAndIsWritable
4650
isNotReadable
4751
isNotWritable
4852
isReadable
@@ -56,6 +60,10 @@ equals
5660
equalsCanonicalizing
5761
equalsIgnoringCase
5862
exists
63+
existsAndIsNotReadable
64+
existsAndIsNotWritable
65+
existsAndIsReadable
66+
existsAndIsWritable
5967
isNotReadable
6068
isNotWritable
6169
isReadable
@@ -131,7 +139,6 @@ notSame
131139
notTrue
132140
null
133141
same
134-
that
135142
true
136143
```
137144

0 commit comments

Comments
 (0)