File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
8787Expect($user->getNumPosts())->equals(5, 'user have 5 posts');
88+
89+ VerifyThat($user->getRate())->equals(7, 'first user rate is 7');
8890```
8991
9092## Extending
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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+
1729if (!function_exists ('Expect ' ))
1830{
1931 /**
You can’t perform that action at this time.
0 commit comments