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

[2.x] fix: tests in Helpers directory are not executed #753

Merged
merged 1 commit into from Mar 30, 2023

Conversation

gehrisandro
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
Fixed tickets #752

This PR allows to have tests in the "Helpers" directory.

The reason the tests are not executed is because all PHP files in the "Helpers" directory are loaded before building the test suite.
In this case they have a different backtrace which does not contain "overrides/Runner/TestSuiteLoader.php". Therefore I have extended the "Backtrace" class with an additional path to check for: "src/Bootstrappers/BootFiles.php"

Additionally I've added two new tests:

  • it executes tests in the Helpers directory in "tests/Helpers/TestInHelpers.php" to ensure tests in the "Helpers" directory are executed.
  • it can use helpers from helpers directory in "tests/Features/Helpers.php" to ensure the helpers still work (before there was no test covering this feature)

@lukeraymonddowning lukeraymonddowning changed the title fix: tests in Helpers directory are not executed [2.x] fix: tests in Helpers directory are not executed Mar 30, 2023
@nunomaduro nunomaduro merged commit ec35010 into pestphp:2.x Mar 30, 2023
14 checks passed
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.

None yet

2 participants