Error: Class 'Route' not found in routes.php when testing standalone Laravel package using Orchestra Testbench

后端 未结 1 765
迷失自我
迷失自我 2020-12-18 13:16

I\'ve got a bit of a weird issue at the moment.

I\'m currently building a Laravel package which is on Github at https://github.com/matthewbdaly/laravel-error-snapsho

相关标签:
1条回答
  • 2020-12-18 13:39

    As it turned out, the answer was fairly straightforward. I just needed to exclude the routes file from the test coverage generation:

    The filter section from file phpunit.xml:

    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./src</directory>
            <exclude>
                <directory suffix=".php">./src/database</directory>
                <file>./src/routes.php</file>
            </exclude>
        </whitelist>
    </filter>
    
    0 讨论(0)
提交回复
热议问题