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]: Some Architecture tests works incorrectly with BypassFinals enabled #1103

Open
Perf opened this issue Feb 27, 2024 · 0 comments
Open
Labels

Comments

@Perf
Copy link

Perf commented Feb 27, 2024

What Happened

Together with installed package nunomaduro/mock-final-classes, which uses dg/bypass-finals under the hood, execution of the following test produces false result.

It doesn't matter if the class defined as final or not, the test always passes. The same situation happens when testing that class should not be readonly, due to the same reason.

test('entity classes should not be final')
    ->expect('App\Domain\Entity')
    ->classes()
    ->not->toBeFinal();

How to Reproduce

  • Install package nunomaduro/mock-final-classes
  • create Architecture test that tests some class that it's not final
  • run the test
  • it will always pass, disregarding if the class is final or not

Sample Repository

No response

Pest Version

2.34.0

PHP Version

8.3.2

Operation System

Linux

Notes

Probably it should be somehow possible to disable dg/bypass-finals when running architecture tests.

@Perf Perf added the bug label Feb 27, 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