duanjiao5723 2012-08-20 20:32
浏览 95
已采纳

我如何运行phpunit测试?

https://github.com/phpseclib/phpseclib/tree/master/tests

My familiarity with phpunit is pretty lacking. How do I run those tests? I installed phpunit using the following commands (per this website):

pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit

I try doing phpunit MD5Test from the tests/Crypt/Hash directory and get the following:

PHP Fatal error:  Class 'Crypt_Hash_TestCase' not found in /root/phpseclib/trunk/tests/Crypt/Hash/MD5Test.php on line 9

That's not too surprising since Crypt_Hash_TestCase isn't included anywhere. There's a bootstrap.php file but I don't know how to use that either.

  • 写回答

1条回答 默认 最新

  • doudengjin8251 2012-08-21 00:10
    关注

    Run phpunit from this directory: https://github.com/phpseclib/phpseclib The clue is that that is where the the phpunit.xml.dist file is found.

    To run all tests you start it with simply:

    phpunit
    

    If you just want to run the MD5Test tests then (still from that same root directory):

    phpunit tests/Crypt/Hash/MD5Test.php
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用