dingo / api

A RESTful API package for the Laravel and Lumen frameworks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug with PHPUnit coverage: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Dingo\Api\Contract\Routing\Adapter] is not instantiable while building [Dingo\Api\Routing\Router]

oleksandr-roskovynskyi opened this issue · comments

Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 6.20.27
Package version 2.4.7
PHP version 7.4.16

Actual Behaviour

Installed successfull but after
./vendor/bin/phpunit --coverage-clover coverage.xml

I get:
PHP Fatal error: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Dingo\Api\Contract\Routing\Adapter] is not instantiable while building [Dingo\Api\Routing\Router]. in /home/runner/work/MyService/MyService/vendor/laravel/framework/src/Illuminate/Container/Container.php:978

Expected Behaviour

Success complete tests, after ./vendor/bin/phpunit --coverage-clover coverage.xml

Steps to Reproduce

Install this package and run:
./vendor/bin/phpunit --coverage-clover coverage.xml

Possible Solutions

Please help me with the same.
Thank you

Added to phpunit.xml

<filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app</directory>
            <directory suffix=".php">./packages/*/*/src</directory>
            <exclude>
                <file>./packages/same/api/src/routes/api.php</file>
            </exclude>
        </whitelist>
    </filter>