Files
pest/tests/Expect/toBeScalar.php
2020-07-14 08:08:13 +01:00

16 lines
349 B
PHP

<?php
use PHPUnit\Framework\ExpectationFailedException;
test('pass', function () {
expect(1.1)->toBeScalar();
});
test('failures', function () {
expect(null)->toBeScalar();
})->throws(ExpectationFailedException::class);
test('not failures', function () {
expect(42)->not->toBeScalar();
})->throws(ExpectationFailedException::class);