mercredi 30 septembre 2020

PHPUnit Tests in PhpStorm failed in a strange way

I configured PhpStorm so that it can run PHPUnit tests for Drupal sites. In PhpStorm I clicked a button to run a test, then I got the message that the test failed. Of course, in a PhpStorm window I could see the detailed command line for running PHPUnit like following:

/usr/bin/php7.3 xxx/vendor/phpunit/phpunit/phpunit --bootstrap xxx/core/tests/bootstrap.php --configuration xxx/modules/phpunit.xml --teamcity

Then I copied the command line to a terminal in the OS (Ubuntu), and ran it, and guess what, it passed! So I am very confused with the fact, that the same command line will lead to different results in PhpStorm and in a terminal in Ubuntu.

Question one: what could be the reason ?

As I know, for running certain Drupal tests it restricts the user who runs the tests (see following post): https://www.drupal.org/docs/automated-testing/phpunit-in-drupal/running-phpunit-tests#s-permission-problems

When running the tests in a Ubuntu Terminal, the user is dev, with this user the tests are OK (because I've adjusted the server configuration according to the post above).

Question two: does PhpStorm takes an other username for running PHPUnit Tests? If so, what is that?

Aucun commentaire:

Enregistrer un commentaire