mirror of
https://github.com/pestphp/pest.git
synced 2026-07-22 01:20:03 +02:00
fix: package lock fingerprint
This commit is contained in:
@@ -1,26 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
$resource = tmpfile();
|
||||
|
||||
afterAll(function () use ($resource) {
|
||||
afterAll(function () use ($resource): void {
|
||||
fclose($resource);
|
||||
});
|
||||
|
||||
test('pass', function () use ($resource) {
|
||||
expect($resource)->toBeResource();
|
||||
expect(null)->not->toBeResource();
|
||||
test('pass', function () use ($resource): void {
|
||||
expect($resource)->toBeResource()
|
||||
->and(null)->not->toBeResource();
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect(null)->toBeResource();
|
||||
test('failures', function (): void {
|
||||
expect()->toBeResource();
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('failures with custom message', function () {
|
||||
expect(null)->toBeResource('oh no!');
|
||||
test('failures with custom message', function (): void {
|
||||
expect()->toBeResource('oh no!');
|
||||
})->throws(ExpectationFailedException::class, 'oh no!');
|
||||
|
||||
test('not failures', function () use ($resource) {
|
||||
test('not failures', function () use ($resource): void {
|
||||
expect($resource)->not->toBeResource();
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
Reference in New Issue
Block a user