【发布时间】:2016-05-10 16:35:07
【问题描述】:
我已经运行了很多测试,但是其中一个路由生成 url 的地方一直失败。
经过检查,它看起来像是在使用默认的 APP_URL。
我已经在 phpunit.xml 中更改了它,但它没有任何区别(即使在清除缓存之后)
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"
syntaxCheck="false">
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<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="APP_URL" value="http://local.dev:8888"/>
<ini name="display_errors" value="true"/>
</php>
</phpunit>
有什么帮助吗?打赌这是愚蠢的事情!
谢谢
【问题讨论】:
-
你是如何运行你的phpunit的?我的意思是哪个参数?
-
无参数 @FelippeDuarte。只是使用
vendor/bin/phpunit我应该使用 args 让我的 xml 生效吗? -
使用 phpunit -c path/to/xml 。在此处查看更多信息:phpunit.de/manual/current/pt_br/textui.html#textui.clioptions