mirror of
https://github.com/pestphp/pest.git
synced 2026-03-05 23:37:22 +01:00
25 lines
618 B
PHP
25 lines
618 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\ExpectationFailedException;
|
|
|
|
expect(true)->toBeTrue()->and(false)->toBeFalse();
|
|
|
|
test('strict comparisons', function () {
|
|
$nuno = new stdClass;
|
|
$dries = new stdClass;
|
|
|
|
expect($nuno)->toBe($nuno)->not->toBe($dries);
|
|
});
|
|
|
|
test('failures', function () {
|
|
expect(1)->toBe(2);
|
|
})->throws(ExpectationFailedException::class);
|
|
|
|
test('failures with custom message', function () {
|
|
expect(1)->toBe(2, 'oh no!');
|
|
})->throws(ExpectationFailedException::class, 'oh no!');
|
|
|
|
test('not failures', function () {
|
|
expect(1)->not->toBe(1);
|
|
})->throws(ExpectationFailedException::class);
|