Files
pest/tests/Features/Expect/toHaveAttribute.php
T
2026-07-18 01:10:01 +01:00

20 lines
642 B
PHP

<?php
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);