mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
19 lines
460 B
PHP
19 lines
460 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\ExpectationFailedException;
|
|
|
|
$obj = new stdClass();
|
|
$obj->foo = 'bar';
|
|
|
|
test('pass', function () use ($obj) {
|
|
expect($obj)->toHaveProperty('foo');
|
|
});
|
|
|
|
test('failures', function () use ($obj) {
|
|
expect($obj)->toHaveProperty('bar');
|
|
})->throws(ExpectationFailedException::class);
|
|
|
|
test('not failures', function () use ($obj) {
|
|
expect($obj)->not->toHaveProperty('foo');
|
|
})->throws(ExpectationFailedException::class);
|