Created
May 16, 2023 11:00
-
-
Save filipfilipovich/ab4fd9cccdaee9a209b7d7a2a1c9211d to your computer and use it in GitHub Desktop.
Pest expectations example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
test('calculation', function () { | |
$result = 2 * 4; | |
expect($result) | |
->toBeInt() // Assert that the result is an integer | |
->toBe(8) // Assert that the result value is 8 | |
->not->toBeJson() // Using "not" modifier, asserting that the value isn't JSON | |
->not->toBe(5); // Another usage example of "not" modifier | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment