PHPUnit、PHPUnit_Framework_TestListener、Netbeans 和 PHPUnit xml 配置
目前我有一个运行 Netbeans、PHPUnit Framework 和 SpiraTeam 的设置。
我正在尝试配置我的 Netbeans 以正确读取侦听器的 xml 配置。
目前似乎根本没有添加监听器。
我知道它正在读取 xml 文件,因为当我没有设置 TestSuite 时,该文件将控制运行哪些测试。
我当前的 phpunit.xml:
<listeners>
<!-- Not loading this? -->
<listener class="SpiraListener_Listener" file="PHPUnit/Util/SpiraListener/Listener.php">
<!-- HOW CAN THIS WORK??? -->
<int>3</int>
</listener>
</listeners>
<testsuites>
<testsuite name="TestSuite">
<file>./TestSuite.php</file>
</testsuite>
<testsuite name="SeleniumTestSuite">
<file>./selenium_ide_suites/TestSuite.php</file>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../models/</directory>
<directory suffix=".php">../system/</directory>
<directory suffix=".php">../controllers/</directory>
<exclude>
<directory>../controllers/app_addons/</directory>
<directory>../controllers/utilities/</directory>
</exclude>
</whitelist>
</filter>
测试将按预期运行,但未添加侦听器。 (也没有给出错误)
所以我真的很困惑下一步该去哪里!
除此之外,如何将参数传递给类?
http://www.phpunit.de/manual/current/en/appendixes .configuration.html
说您可以在 xml 的 Listener 元素中添加更多数据,但该类刚刚实现,这是如何使用/工作的?
感谢您的帮助! ——罗恩
Currently I have a setup running Netbeans, the PHPUnit Framework and SpiraTeam.
I am trying to configure my Netbeans to properly read the xml config for Listeners.
Currently is doesn't seem to be adding the listener at all.
I know it's reading the xml file because when I do not set a TestSuite this file will control what tests are run.
My current phpunit.xml:
<listeners>
<!-- Not loading this? -->
<listener class="SpiraListener_Listener" file="PHPUnit/Util/SpiraListener/Listener.php">
<!-- HOW CAN THIS WORK??? -->
<int>3</int>
</listener>
</listeners>
<testsuites>
<testsuite name="TestSuite">
<file>./TestSuite.php</file>
</testsuite>
<testsuite name="SeleniumTestSuite">
<file>./selenium_ide_suites/TestSuite.php</file>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../models/</directory>
<directory suffix=".php">../system/</directory>
<directory suffix=".php">../controllers/</directory>
<exclude>
<directory>../controllers/app_addons/</directory>
<directory>../controllers/utilities/</directory>
</exclude>
</whitelist>
</filter>
And the tests will run as expected but no listener was added. (no error given either)
So I'm really confused as to where to look next!
In addition to that How can you pass params to the class?
http://www.phpunit.de/manual/current/en/appendixes.configuration.html
Says you can add more data in the Listener element of the xml BUT the class is just implemented how is this used / working?
Thanks for any help!
--Ron
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来你的监听器的语法有点不对劲。
尝试:
Seems like the syntax of your listener is a little off.
Try: