Skip to content

Commit

Permalink
Merge pull request #40 from Codeception/test-with-phpunit8
Browse files Browse the repository at this point in the history
Test compatibility with PHPUnit 8 and new assertions
  • Loading branch information
Naktibalda authored Jul 30, 2019
2 parents a4ce274 + ee6ca60 commit fa0bb94
Show file tree
Hide file tree
Showing 6 changed files with 227 additions and 1,478 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,32 @@ verify($user->getPosts())->notNull();
// empty
verify($user->getComments())->isEmpty();
verify($user->getRoles())->notEmpty();

//Other methods:
* stringContainsString
* stringNotContainsString
* stringContainsStringIgnoringCase
* stringNotContainsStringIgnoringCase
* array
* bool
* float
* int
* numeric
* object
* resource
* string
* scalar
* callable
* notArray
* notBool
* notFloat
* notInt
* notNumeric
* notObject
* notResource
* notString
* notScalar
* notCallable
```

Shorthands for testing truth/fallacy:
Expand All @@ -51,6 +77,7 @@ verify_that($user->isActivated());
verify_not($user->isBanned());
```


These two functions don't check for strict true/false matching, rather `empty` function is used.
`verify_that` checks that result is not empty value, `verify_not` does the opposite.

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
],
"require": {
"php": ">= 7.0",
"phpunit/phpunit": "> 6.0"
"phpunit/phpunit": "> 6.0",
"codeception/phpunit-wrapper": ">6.0.15 <6.1.0 | ^6.6.1 | ^7.7.1 | ^8.0.4"
},
"autoload": {
"files": ["src/Codeception/function.php"],
Expand Down
Loading

0 comments on commit fa0bb94

Please sign in to comment.