0

I am trying to run phpunit tests in Drupal 8.5.2. PHP 7.1.1, windows 10. Xdebug.

The project is built with composer and includes acquia/lightning": "~3.1.0. "phpunit/phpunit": "^4.8.36"

The tests fail in intellij with an error:

Fatal error: Class 'Drupal\Tests\UnitTestCase' not found in C:\xampp\htdocs\project\docroot\modules\custom\project\modules\project\tests\src\Unit\CenterServiceTest.php

It fails on the UnitTestCase extension.

/** * Tests the foo entity. * * @group project_api */ class CenterServiceTest extends UnitTestCase {

The UnitTestCase file is in the expected folder. I've gone through the pages: https://www.drupal.org/docs/develop/development-tools/configuring-phpstorm https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html#updatingPhpIni https://www.jetbrains.com/help/phpstorm/10.0/configuring-xdebug.html https://www.jetbrains.com/help/idea/2018.1/validating-the-configuration-of-the-debugging-engine.html

and some other related pages. I still seem to have the issue. Any ideas out there? Thanks!

The php.ini xdebug entry:

[xdebug] zend_extension=c:\xampp\php\ext\php_xdebug-2.5.5-7.1-vc14.dll xdebug.remote_enable=1 xdebug.remote_port=9000 xdebug.profiler_enable=1 xdebug.profiler_output_dir = "c:\xampp\tmp" xdebug.remote_autostart = 1 xdebug.profiler_append = 0 xdebug.profiler_enable_trigger = 0 ;xdebug.profiler_output_name = "cachegrind.out.%t-%s" xdebug.remote_handler = "dbgp" xdebug.remote_host = "127.0.0.1" xdebug.remote_log = "c:\xampp\tmp\xdebug.txt" xdebug.trace_output_dir = "c:\xampp\tmp" xdebug.remote_cookie_expire_time = 36000 xdebug.show_local_vars=1 xdebug.max_nesting_level=1000

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.