2015-10-20 10:18:09 5422次浏览 1条回答 4 悬赏 100 金钱

有没有那位大神写过yii2的单元测试codeception的,能不能说下这个怎么在yii2项目下运行,codeception除了官网外,有没有详细的单元测试文档啊,求推荐一个网址

最佳答案

  • naivefang 发布于 2015-10-20 16:10 举报

    见这个文章:http://hustnaive.github.io/php/2015/06/16/work-with-yii-and-codeception.html

    codeception很好很强大,但是,如果只是单元测试的话,建议直接用phpunit,稍微简单些。codeception配置较为麻烦。

    4 条回复
    回复于 2015-10-20 17:35 回复
    1) Testpost in (TokenTest::testpostIndex)
      [yii\base\ErrorException] array_merge(): Argument #2 is not an array
    
    #1  yii\base\ErrorHandler->handleError
    #2  /home/wwwroot/default/pos/posweb2/vendor/yiisoft/yii2/test/FixtureTrait.php:132
    #3  /home/wwwroot/default/pos/posweb2/vendor/yiisoft/yii2/test/FixtureTrait.php:109
    #4  /home/wwwroot/default/pos/posweb2/vendor/yiisoft/yii2-codeception/TestCase.php:84
    #5  /home/wwwroot/default/pos/posweb2/tests/codecept.phar:7
    

    为什么我运行之后老是提示这个错误?

    回复于 2015-10-21 09:04 回复

    这个需要看你的测试代码

    回复于 2015-10-22 09:53 回复

    还是使用phpunit写了

    回复于 2016-04-16 16:30 回复

    请问用phpunit怎么运行起来的呢?我有项目从yii1升级到yii2,单测跑不起来,直接phpunit xxxx 也不行

    没有找到数据。
您需要登录后才可以回答。登录 | 立即注册
心雨
主管

心雨

注册时间:2015-07-23
最后登录:2020-03-31
在线时长:20小时35分
  • 粉丝5
  • 金钱175
  • 威望20
  • 积分575

热门问题