tests helpers class #1180
samcoppock
started this conversation in
General
Replies: 1 comment 3 replies
-
Which tests are you running ? The bootstrap file is included when extending One example is |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In a previous version of winter this file existed.
"tests/bootstrap.php"
In our project we have to use it or else the test dont work and we append it using
"-dauto_prepend_file=" when running tests manually on the CLI using the phpunit command.
In the most recent version of Winter "tests/bootstrap.php" no longer exists and appears to have been replaced with "modules/system/tests/bootstrap/app.php"
I assumed that the new "php artisan winter:test" command would automatically bootstrap this file.
But it does not - I know this because I placed die statements in the file and none of them activated.
And of course even with the die statements removed the tests failed because the bootstrap file was not loaded.
Also when running the tests using the php unit command I have to use "-dauto_prepend_file=" to add ether the new "modules/system/tests/bootstrap/app.php" file or the old "tests/bootstrap.php" file ( which we still have in our codebase ) in order to make the tests work. ( that is to say both versions of the file still work - although the old one has had some of the new ones code copy/pasted into it)
Which leads to my question
How do I include "modules/system/tests/bootstrap/app.php" when running tests using "php artisan winter:test" to run tests?
Beta Was this translation helpful? Give feedback.
All reactions