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

Arch testing expectation parameters for not->toBeUsedIn() #1260

Open
adamthehutt opened this issue Sep 16, 2024 · 0 comments
Open

Arch testing expectation parameters for not->toBeUsedIn() #1260

adamthehutt opened this issue Sep 16, 2024 · 0 comments

Comments

@adamthehutt
Copy link

The documentation on architecture testing doesn't provide a lot of information on what is supported when using "toBeUsedIn".

I'm trying to test that no model observers are registered within a certain namespace. Some of the things I've tried that don't work:

arch('observers')
->expect('observe')
->not->toBeUsedIn('The\Namespace');

arch('observers')
->expect([Model::class, 'observe'])
->not->toBeUsedIn('The\Namespace');

arch('observers')
->expect(Model::class . '@observe')
->not->toBeUsedIn('The\Namespace');

None of these work. Is this kind of test possible? If so, what syntax should I be using? Thank you!

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

No branches or pull requests

1 participant