dtby67541 2011-05-20 03:33
浏览 58
已采纳

PHPUnit,PHPUnit_Framework_TestListener,Netbeans和PHPUnit xml配置

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

  • 写回答

1条回答 默认 最新

  • dongshike7171 2011-05-20 22:58
    关注

    Seems like the syntax of your listener is a little off.

    Try:

    <listeners>
      <listener class="SpiraListener_Listener" file="PHPUnit/Util/SpiraListener/Listener.php">
        <arguments>
          <integer>3</integer>
        </arguments>
      </listener>
    </listeners>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?