mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
18 lines
515 B
PHP
18 lines
515 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\ExpectationFailedException;
|
|
|
|
test('pass', function () {
|
|
expect([1, 2, 3])->toContainOnly('int');
|
|
expect(['hello', 'world'])->toContainOnly('string');
|
|
});
|
|
|
|
test('failures', function () {
|
|
expect([1, 2, '3'])->toContainOnly('string');
|
|
})->throws(ExpectationFailedException::class);
|
|
|
|
test('not failures', function () {
|
|
expect([1, 2, 3])->not->toContainOnly('int');
|
|
expect(['hello', 'world'])->not->toContainOnly('string');
|
|
})->throws(ExpectationFailedException::class);
|