Skip to content

Commit 397a2f3

Browse files
committed
VerifyThat included again.
1 parent c559be6 commit 397a2f3

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ Verify::Callable($callback)
8181
8282
## Alternative Syntax
8383

84-
If you follow TDD/BDD you'd rather use `Expect` instead of `Verify`. Which are just an alias function:
84+
If you follow TDD/BDD you'd rather use `Expect` or `VerifyThat` instead of `Verify`. Which are just an alias function:
8585

8686
```php
8787
Expect($user->getNumPosts())->equals(5, 'user have 5 posts');
88+
89+
VerifyThat($user->getRate())->equals(7, 'first user rate is 7');
8890
```
8991

9092
## Extending

UPGRADE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Verify function
1212
-------
1313

1414
* `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.
15+
* `verify_that` was deleted. Use `VerifyThat` instead.
16+
* `verify_not` was deleted. Use `Verify()->empty` instead.
1617
* `expect_that` and `expect_not` were deleted. Use `Expect()->notEmpty` and `Expect()->empty` instead.
1718
* `expect_file` and `setIsFileExpectation` were deleted. Use `Verify::File()` instead.
1819

src/Codeception/bootstrap.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ function Verify($actual): VerifyMixed
1414
}
1515
}
1616

17+
if (!function_exists('VerifyThat'))
18+
{
19+
/**
20+
* @param mixed $actual
21+
* @return VerifyMixed
22+
*/
23+
function VerifyThat($actual): VerifyMixed
24+
{
25+
return new VerifyMixed($actual);
26+
}
27+
}
28+
1729
if (!function_exists('Expect'))
1830
{
1931
/**

0 commit comments

Comments
 (0)