Arch testing expectation parameters for not->toBeUsedIn()
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!
According to the docs, this should work: https://pestphp.com/docs/arch-testing#content-tobeusedin
If it's not working, then this is a bug.
Question, though. Where did it tell you to use arch('observers') and ->expect('observe')?
We don't support methods on the toBeUsedIn at the moment.