mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
24 lines
655 B
PHP
24 lines
655 B
PHP
<?php
|
|
|
|
use Pest\Actions\AddsTests;
|
|
use Pest\Expectation;
|
|
use PHPUnit\Framework\ExpectationFailedException;
|
|
|
|
test('pass', function () {
|
|
$expected = [new Expectation('whatever')];
|
|
|
|
expect($expected)->toContainOnlyInstancesOf(Expectation::class);
|
|
});
|
|
|
|
test('failures', function () {
|
|
$expected = [new Expectation('whatever')];
|
|
|
|
expect($expected)->toContainOnlyInstancesOf(AddsTests::class);
|
|
})->throws(ExpectationFailedException::class);
|
|
|
|
test('not failures', function () {
|
|
$expected = [new Expectation('whatever')];
|
|
|
|
expect($expected)->not->toContainOnlyInstancesOf(Expectation::class);
|
|
})->throws(ExpectationFailedException::class);
|