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

Fix stub PHPUnit\Framework\TestCase #1954

Merged
merged 6 commits into from
Mar 22, 2022
Merged

Fix stub PHPUnit\Framework\TestCase #1954

merged 6 commits into from
Mar 22, 2022

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Mar 22, 2022

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@samsonasik
Copy link
Member Author

@TomasVotruba placing in preload.php seems make it checked too early for used as composer require rector/rector, which make not load original PHPUnit\Framework\TestCase when exists, while technically doesn't make error on rector run, should it be better place after

$autoloadIncluder->autoloadFromCommandLine();

another possible location is place at include bootstrap file, at

require_once $bootstrapFile;

what do you think?

@TomasVotruba
Copy link
Member

TomasVotruba commented Mar 22, 2022

@samsonasik Personally I'd go with 1:1 setup to PHPStan, so this file should be included in bootstrap files. Avoding any mock magic.
By keeping this standard, we'll have the same standardized solution for future cases.

@samsonasik
Copy link
Member Author

@TomasVotruba ok, I updated to load in BootstrapFilesIncluder after all bootstrap file loaded 8978258 with the following steps:

  • check if __DIR__ . '/../../stubs-rector/PHPUnit/Framework/TestCase.php' exists, load
  • copy stubs-rector/PHPUnit/Framework/TestCase.php' on build scoped

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@samsonasik
Copy link
Member Author

I moved to target-repository for use it only in scoped.

@samsonasik
Copy link
Member Author

Let's give it a try ;)

@samsonasik samsonasik merged commit 8f86f52 into main Mar 22, 2022
@samsonasik samsonasik deleted the update-stub branch March 22, 2022 14:32
@samsonasik
Copy link
Member Author

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

Successfully merging this pull request may close these issues.

2 participants