Wuanshu
275
10
Testing

A facade root has not been set

Posted 2 months ago by Wuanshu

Hi everyone. I am trying to run some tests on my Laravel application but I'm stuck. When I run the command ./vendor/bin/phpunit --coverage-html public/tests I get this error:

Fatal error: Uncaught Error: Class 'Broadcast' not found in /var/www/html/app/Api/AccountingScope/AccountingScopeChannels.php on line 5

Error: Class 'Broadcast' not found in /var/www/html/app/Api/AccountingScope/AccountingScopeChannels.php on line 5

Call Stack:
    0.0002     420064   1. {main}() /var/www/html/vendor/phpunit/phpunit/phpunit:0
    0.0492    6092808   2. PHPUnit\TextUI\Command::main() /var/www/html/vendor/phpunit/phpunit/phpunit:61
    0.0492    6092920   3. PHPUnit\TextUI\Command->run() /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:163
    0.2355    8833032   4. PHPUnit\TextUI\TestRunner->doRun() /var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:207
    0.7388    9373928   5. PHPUnit\Framework\TestSuite->run() /var/www/html/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:613
    0.7398    9374120   6. PHPUnit\Framework\TestSuite->run() /var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php:761
    0.7405    9374312   7. PHPUnit\Framework\TestSuite->run() /var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php:761
    0.7450    9374880   8. Tests\Unit\Console\Commands\MakeEndpointTest->run() /var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php:761
    0.7450    9374880   9. PHPUnit\Framework\TestResult->run() /var/www/html/vendor/phpunit/phpunit/src/Framework/TestCase.php:808
    0.7454    9450856  10. SebastianBergmann\CodeCoverage\CodeCoverage->start() /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:640
    0.7454    9450856  11. SebastianBergmann\CodeCoverage\CodeCoverage->initializeData() /var/www/html/vendor/phpunit/php-code-coverage/src/CodeCoverage.php:241
    0.7720   10266272  12. include_once('/var/www/html/app/Api/AccountingScope/AccountingScopeChannels.php') /var/www/html/vendor/phpunit/php-code-coverage/src/CodeCoverage.php:961

I don't know much about testing yet so if you need more info, I'll provide.

Please sign in or create an account to participate in this conversation.