mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
feat: adds toUseTraits expectation
This commit is contained in:
16
tests/Features/Expect/toUseTrait.php
Normal file
16
tests/Features/Expect/toUseTrait.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use Pest\Arch\Exceptions\ArchExpectationFailedException;
|
||||
|
||||
test('pass', function () {
|
||||
expect('Pest\Expectations\HigherOrderExpectation')->toUseTrait('Pest\Concerns\Retrievable')
|
||||
->and('Pest\Expectations\EachExpectation')->not->toUseTrait('Pest\Concerns\Retrievable');
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect('Pest\Expectations\EachExpectation')->toUseTrait('Pest\Concerns\Foo');
|
||||
})->throws(ArchExpectationFailedException::class);
|
||||
|
||||
test('not failures', function () {
|
||||
expect('Pest\Expectations\HigherOrderExpectation')->not->toUseTrait('Pest\Concerns\Retrievable');
|
||||
})->throws(ArchExpectationFailedException::class);
|
||||
Reference in New Issue
Block a user