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 ddev phpunit command when initializing the project with ddev drowl-init-dev #173

Open
joshsedl opened this issue Jul 31, 2024 · 2 comments

Comments

@joshsedl
Copy link
Collaborator

Our ddev drowl-init-dev command initiates drupal using Joachims drupal-core-development-project.
And because of the symlink created on the vendor/folder, the phpunit ddev command fails with the following error:

PHP Warning:  require(/var/www/html/repos/drupal/vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/html/repos/drupal/autoload.php on line 13

see joachim-n/drupal-core-development-project#14 for more information. For the time being you can execute core tests, executing vendor/bin/phpunit web/core/PATH-TO-TEST-FILE/TestFile.php from the project root, but that requires the current php version installed locally on your computer instead of it being installed in your container instance.

@joshsedl
Copy link
Collaborator Author

joshsedl commented Jul 31, 2024

Ok, the provided error doesn't come from the symlink issue. In the symlinked drupal repo, we get untracked "sites/simpletest" and "vendor" folders, which we remove on "ddev drowl-init-dev". These are actually required for phpunit to work for some reason. But they show up as untracked files, when working in core issues (so we removed them on init).
THESE files are required for core tests to be exectued with ddev phpunit. To get these files back, simply require any existing package (e.g. ddev composer require composer-runtime-api), and they will appear again and you will be able to test. BUT CAREFUL! Do NOT commit them into core issues!

@joshsedl
Copy link
Collaborator Author

Note, also set the "BROWSERTEST_OUTPUT_BASE_URL" in your phpunit.xml accordingly.

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

No branches or pull requests

1 participant