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

Difference between PHPUnit Tests included with Bolt versus PHPUnit tests in my custom module #143

Closed
justinlevi opened this issue Jun 10, 2016 · 3 comments

Comments

@justinlevi
Copy link
Contributor

I can run the PHPUnit tests that come with Bolt from within PHPStorm no problem and even throw a breakpoint in one of the methods and debug no problem.

However, I'm trying to figure out why I can't debug a PHPUnit test in one of my custom modules from within PHPStorm. When I right click on my test class in PHPStorm, I am prompted to create a test configuration for either a javascript file or a php script whereas if I click on one of the Bolt PHPUnit tests, PHPStorm just seems to "know" that it's a PHPUnit test.

I've detailed the issue further on the Drupal-VM issue queue and on stackexchange:

geerlingguy/drupal-vm#716

http://drupal.stackexchange.com/questions/203801/how-can-i-debug-phpunit-simpletests-for-a-custom-d8-module-in-phpstorm

I realize this is kind of off topic so thanks for any help. I'm just trying to debug a few instance variables in a method and would rather not print to the screen.

@grasmash
Copy link
Contributor

It may have to do with our use of phpunit.xml, which defines the autoloader and consequently recognizes the namespaces: https://github.com/acquia/blt/blob/8.x/template/tests/phpunit/phpunit.xml

@justinlevi
Copy link
Contributor Author

@grasmash Thanks for the response!

I naively tried to create the phpunit.xml at the same level as my test class,updating the path, but that didn't seem to help anything. Where is that xml being loaded/used? I'm not really sure what the phpunit.xml does in this case.

@grasmash
Copy link
Contributor

The xml is being used in the test:phpunit target. When you are executing phpunit tests, make sure that you're using the phpunit binary located in your project's vendor/bin directory.

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

2 participants