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]: method directoriesByNamespace replacing prefix multiple times resulting in false positive because the directory is not found #1164

Open
mateusdeitos-tiny opened this issue Jun 3, 2024 · 0 comments
Labels

Comments

@mateusdeitos-tiny
Copy link

What Happened

when running

arch('App\Application\Exception')
	->expect('App\Application\Exception')
	->toExtend(RequestException::class);

the method ObjectsRepository@directoriesByNamespace remove the prefix twice if the prefix is also present in another part of the namespace.

Example:

image

How to Reproduce

  • Start a new project with pest-php
  • Create a new class in the namespace App\Application\Exception
  • run this test (it will pass but no directory will be found to actually test it)
arch('App\Application\Exception')
	->expect('App\Application\Exception')
	->toExtend(RequestException::class);

Sample Repository

No response

Pest Version

2.34.7

PHP Version

8.3.7

Operation System

Linux

Notes

No response

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