Files
pest/tests/Features/Expect/extend.php
T
2026-07-18 01:10:01 +01:00

30 lines
714 B
PHP

<?php
expect()->extend('toBeAMacroExpectation', function (): object {
$this->toBeTrue();
return $this;
});
expect()->extend('toBeAMacroExpectationWithArguments', function (bool $value): object {
$this->toBe($value);
return $this;
});
it('macros true is true', function (): void {
expect(true)->toBeAMacroExpectation();
});
it('macros false is not true', function (): void {
expect(false)->not->toBeAMacroExpectation();
});
it('macros true is true with argument', function (): void {
expect(true)->toBeAMacroExpectationWithArguments(true);
});
it('macros false is not true with argument', function (): void {
expect(false)->not->toBeAMacroExpectationWithArguments(true);
});