Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add modifiers for filtering classes by trait, interface, and inheritance in arch tests #19

Open
wants to merge 2 commits into
base: 3.x
Choose a base branch
from

Conversation

yondifon
Copy link

This update adds modifiers to filter classes in architectural tests by their traits, interfaces, and inheritance, enabling more precise

  • extending(): Filters classes that extend a specific
  • implementing(): Filters classes that implement a specific interface
  • usingTrait(): Filters classes that directly use a specific trait

e.g.
// Ensure that all Laravel Jobs implementing ShouldQueue use the InteractsWithQueue and Batchable traits

expect('App\Jobs')
    ->classes()
    ->implementing(ShouldQueue::class)
    ->toUseTrait(InteractsWithQueue::class)

tests/Modifiers.php Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants