Запуск PHPUnit из Eclipse дает 0% покрытия кодаPhp

Кемеровские программисты php общаются здесь
Ответить
Гость
 Запуск PHPUnit из Eclipse дает 0% покрытия кода

Сообщение Гость »


I'm a beginner with Eclipse and PHPUnit. I think I configured my PHP project correctly to run PHPUnit with code coverage. My problem is : when I run PHPUnit from Eclipse, the tests are executed normally, the html report is generated, but all coverage lines and functions have the value "0%" :
Изображение
If I run PHPUnit in the terminal with the command vendor/bin/phpunit (it uses the same phpunit.xml than in Eclipse) the html content is correct :
Изображение
I don't understand why the coverage is empty if I start PHPUnit from Eclipse. Do you have an idea for me ?
Thanks for your help !
Softwares versions I use :
  • Eclipse 2023-12 (4.30.0)
  • PHP 8.1.2
  • PHPUnit 9.6 (installed with Composer)
My phpunit.xml :

Код: Выделить всё




tests/unit




src






The Eclipse profile I use to start PHPUnit :
Изображение
In Eclipse, I started the debugger to get the phpunit command line parameters and start the program with the same parameters in the terminal :

Код: Выделить всё

path/of/phpunit --include-path /tmp/phpunit_printer --printer PHPUnitLogger --configuration /path/of/my/project/phpunit.xml /path/of/my/project/tests/unit
The code coverage is documented, as when I run phpunit without parameters.


Источник: https://stackoverflow.com/questions/781 ... e-coverage
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Php»