Symfony3 phpunit xml
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Symfony3 phpunit xml,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1799字,纯文字阅读大概需要3分钟。
内容图文
![Symfony3 phpunit xml](/upload/InfoBanner/zyjiaocheng/819/80522ea198914f239d5db5dbdbb6ea9a.jpg)
嘿所有在我的Symfony3项目中安装了PhpUnit,当我在我的终端bin / phpunit -c应用程序中运行时,我收到此错误:
Could not load XML from empty string
谷歌搜索它,结果我需要在我的app /目录中应用phpunit.xml文件,所以我做了,它看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "autoload.php" >
<testsuites>
<testsuite name="Project Test Suite">
<directory>../src/*/*Bundle/Tests</directory>
<!--directory>../src/*/Bundle/*Bundle/Tests</directory-->
</testsuite>
</testsuites>
<!--
<php>
<server name="KERNEL_DIR" value="/path/to/your/app/" />
</php>
-->
<filter>
<whitelist>
<directory>../src</directory>
<exclude>
<directory>../src/*/*Bundle/Resources</directory>
<directory>../src/*/*Bundle/Tests</directory>
<!--directory>../src/*/Bundle/*Bundle/Resources</directory>
<directory>../src/*/Bundle/*Bundle/Tests</directory-->
</exclude>
</whitelist>
</filter>
</phpunit>
所以现在它工作正常,但我无法找到答案的问题是:
>为什么php单元需要这个文件我可以看到文件显示phpunit在哪里寻找测试,但这就是全部吗?
>我手动创建了这个文件有没有办法像终端命令一样自动创建它.
>据我所知,<白名单>是phpunit允许“看”的地方?和< exlude>它的phpunit不允许“看”?如果是这样,为什么这个< directory> ../ src / * / * Bundle / Tests< / directory>在< exlude>中如果测试的地方.
解决方法:
使用新的symfony3目录结构,PHPUnit配置文件位于项目的根目录中,因此您不再需要指定-c params(配置).所以你可以简单地启动如下:
>bin/phpunit
希望这有帮助
内容总结
以上是互联网集市为您收集整理的Symfony3 phpunit xml全部内容,希望文章能够帮你解决Symfony3 phpunit xml所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。