나는 드문 문제이지만 필자는 최대한 명확하게 설명하려고 노력할 것입니다. 나는이 있었던이Artisan 명령에서 PHPUnit을 호출하면 XML 파일을 무시합니다.
/**
* Execute the console command.
*/
public function handle()
{
$this->info("==> Cleaning up reports and docs...");
$command = new Process("rm -f tests/docs/* && rm -rf test/reports/*");
$command->run();
$this->warn("==> Reports and docs are clean");
$this->info("==> Executing Tests Suite...");
$command = new Process("vendor/bin/phpunit --coverage-html tests/reports --testdox-html tests/docs/reports.html -v --debug");
$command->run();
$this->info($command->getIncrementalOutput());
$this->warn("==> report generated >> test/reports. Documentation generated >> test/docs/reports.html");
}
을하지 좀 이상한 것 같지만 실제로 꽤 유용 간단한 장인 명령을 만들었습니다, 그것은 커버리지 지원 및 기타 물건으로 phpunit을을 시작합니다. 문제는 내가 php artisan ludo237:full-test
처럼이 명령을 실행하면 사실 phpunit.xml
을 무시하고 MySQL 데이터베이스가 존재하지 않는다는 오류가 표시됩니다. 내 phpunit.xml
내에서 sqlite 연결을 설정 했더라도 명확하게이 올바른지 참조 :
<?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="Application Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_DEBUG" value="true"/>
<env name="APP_URL" value="http://localhost:8000"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:" />
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="MAIL_DRIVER" value="log"/>
<env name="MAIL_PRETEND" value="true"/>
</php>
</phpunit>
나는 단순히이 내 현재 핫픽스입니다 실제로 그 명령 행에 대한 bash는 별칭을 만들 수 있다는 것을 알고 있지만,이 시점에서 난 그냥 궁금해서 왜 때 이해하기 artisan 명령에서 phpunit 명령을 실행하면 XML 파일이 무시됩니다.
누구에 대한 실마리가 있습니까? 고맙습니다!
당신이 노력하자 for.your 감사 제안
force
속성 :안부, 줄리안를 추가 할 수의 기다려 보자 문제가 업데이트되는지 확인하십시오. –