0
votes

Testing started at 下午5:45 ...

/usr/local/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9001 -dxdebug.remote_host=127.0.0.1 /var/www/example/vendor/phpunit/phpunit/phpunit --no-configuration --filter "/(::testMerlinTemplate)( .*)?$/" tests\jobs\SettlementJobTest /var/www/example/tests/unit/jobs/SettlementJobTest.php --teamcity
PHPUnit 7.1.4 by Sebastian Bergmann and contributors.


Codeception\Exception\InjectionException : Service di is not defined and can't be accessed from a test
 /var/www/example/vendor/codeception/base/src/Codeception/Test/Metadata.php:191
 /var/www/example/vendor/codeception/base/src/Codeception/Test/Unit.php:47
1

1 Answers

1
votes

You're trying to run a Codeception unit test using phpunit, the di (dependency injection) service is not available in the latter. You should run the test using the Codeception CLI, e.g.:

codecept run /var/www/example/tests/unit/jobs/SettlementJobTest.php