mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
27 lines
674 B
PHP
27 lines
674 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\ExpectationFailedException;
|
|
|
|
test('passes', function () {
|
|
expect(false)->toBeFalsy();
|
|
expect('')->toBeFalsy();
|
|
expect(null)->toBeFalsy();
|
|
expect([])->toBeFalsy();
|
|
expect(0)->toBeFalsy();
|
|
expect('0')->toBeFalsy();
|
|
|
|
expect(true)->not->toBeFalsy();
|
|
expect([1])->not->toBeFalsy();
|
|
expect('false')->not->toBeFalsy();
|
|
expect(1)->not->toBeFalsy();
|
|
expect(-1)->not->toBeFalsy();
|
|
});
|
|
|
|
test('failures', function () {
|
|
expect(1)->toBeFalsy();
|
|
})->throws(ExpectationFailedException::class);
|
|
|
|
test('not failures', function () {
|
|
expect(null)->not->toBeFalsy();
|
|
})->throws(ExpectationFailedException::class);
|