mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
27 lines
647 B
PHP
27 lines
647 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\ExpectationFailedException;
|
|
|
|
test('pass', function () {
|
|
$object = new stdClass();
|
|
$object->name = 'Jhon';
|
|
$object->age = 21;
|
|
|
|
expect($object)->toHaveProperties(['name', 'age']);
|
|
});
|
|
|
|
test('failures', function () {
|
|
$object = new stdClass();
|
|
$object->name = 'Jhon';
|
|
|
|
expect($object)->toHaveProperties(['name', 'age']);
|
|
})->throws(ExpectationFailedException::class);
|
|
|
|
test('not failures', function () {
|
|
$object = new stdClass();
|
|
$object->name = 'Jhon';
|
|
$object->age = 21;
|
|
|
|
expect($object)->not->toHaveProperties(['name', 'age']);
|
|
})->throws(ExpectationFailedException::class);
|