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 在若依框架下实现人脸识别
  • ¥15 网络科学导论,网络控制
  • ¥100 安卓tv程序连接SQLSERVER2008问题
  • ¥15 利用Sentinel-2和Landsat8做一个水库的长时序NDVI的对比,为什么Snetinel-2计算的结果最小值特别小,而Lansat8就很平均
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同