mirror of
https://github.com/pestphp/pest.git
synced 2026-07-21 17:10:03 +02:00
22 lines
668 B
PHP
22 lines
668 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Pest\Arch\Exceptions\ArchExpectationFailedException;
|
|
use Tests\Fixtures\Arch\ToHaveAttribute\Attributes\AsAttribute;
|
|
|
|
test('class has attribute')
|
|
->expect('Tests\\Fixtures\\Arch\\ToHaveAttribute\\HaveAttribute')
|
|
->toHaveAttribute(AsAttribute::class);
|
|
|
|
test('opposite class has attribute')
|
|
->throws(ArchExpectationFailedException::class)
|
|
->expect('Tests\\Fixtures\\Arch\\ToHaveAttribute\\HaveAttribute')
|
|
->not
|
|
->toHaveAttribute(AsAttribute::class);
|
|
|
|
test('class not has attribute')
|
|
->expect('Tests\\Fixtures\\Arch\\ToHaveAttribute\\NotHaveAttribute')
|
|
->not
|
|
->toHaveAttribute(AsAttribute::class);
|