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

[Bug]: PHPUnit namespace connot be used in architecture tests? #1318

Open
parijke opened this issue Nov 20, 2024 · 0 comments
Open

[Bug]: PHPUnit namespace connot be used in architecture tests? #1318

parijke opened this issue Nov 20, 2024 · 0 comments
Labels

Comments

@parijke
Copy link

parijke commented Nov 20, 2024

What Happened

I have two architecture tests to prevent usage in the code base. These are:

arch('ensures Eloquent Collections are only used in Repository namespace')
    ->expect('Illuminate\Database\Eloquent\Collection')
    ->toOnlyBeUsedIn('App\Repositories');

arch('ensures PHPUnit namespace is not used in App namespace')
    ->expect('PHPUnit\Framework\Assert')
    ->toOnlyBeUsedIn('App\Repositories');

The test with the Collection works as expected, as usage of PHPUnit\Framework\Assert remains undetected

How to Reproduce

Use PHPUnit\Framework\Assert somewhere else than App\Repositories

Sample Repository

No response

Pest Version

3.5.1

PHP Version

8.3.13

Operation System

Linux

Notes

No response

@parijke parijke added the bug label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant