Skip to content

Instantly share code, notes, and snippets.

@filipfilipovich
Created May 16, 2023 11:00
Show Gist options
  • Save filipfilipovich/ab4fd9cccdaee9a209b7d7a2a1c9211d to your computer and use it in GitHub Desktop.
Save filipfilipovich/ab4fd9cccdaee9a209b7d7a2a1c9211d to your computer and use it in GitHub Desktop.
Pest expectations example
<?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