0

I try to run php artisan test --coverage (laravel unit testing) but i get 2 errors

 WARN  No filter is configured, code coverage will not be processed

and 2

 WARN  Unable to get coverage using Xdebug. Did you set Xdebug's coverage mode?

I dont get it i have php8.1 and 8.2 and in both the fpm and the cli php.ini i have

xdebug.mode=coverage,debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9003

If i do php -v i get

PHP 8.2.14 (cli) (built: Dec 21 2023 20:18:00) (NTS)
   Copyright (c) The PHP Group
   Zend Engine v4.2.14, Copyright (c) Zend Technologies
with Zend OPcache v8.2.14, Copyright (c), by Zend Technologies
with Xdebug v3.3.0, Copyright (c) 2002-2023, by Derick Rethans

I do not see what the problem is.

Ivar
  • 1

1 Answers1

0

So the second error is misleading, the first the solution

It whas a case of rtfm i should add to phpunit.xml

<source>
    <include>
        <directory suffix=".php">./app</directory>
    </include>
</source>

representing the files i want to be checked in the report. This fixes both errors.

Detailed info: click here

Ivar
  • 1