Tag: docker phpunit

为什么phpunit得不到phpunit.xml中指定的正确的APP_ENV?

我正在使用Laravel,这是我的./phpunit.xml文件 <?xml version="1.0" encoding="UTF-8"?> <phpunit backupGlobals="false" backupStaticAttributes="false" bootstrap="bootstrap/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false"> <testsuites> <testsuite name="FeatureTests"> <directory suffix="Test.php">./tests/Feature</directory> </testsuite> <testsuite name="UnitTests"> <directory suffix="Test.php">./tests/Unit</directory> </testsuite> </testsuites> <filter> <whitelist processUncoveredFilesFromWhitelist="true"> <directory suffix=".php">./app</directory> </whitelist> </filter> <php> <env name="APP_ENV" value="testing"/> <env name="CACHE_DRIVER" value="array"/> <env name="SESSION_DRIVER" value="array"/> <env name="QUEUE_DRIVER" value="sync"/> <env name="DB_CONNECTION" value="sqlite_testing" /> </php> </phpunit> 我用下面的命令发射我的一个testing套件: ./vendor/phpunit/phpunit/phpunit –testsuite […]