Codeception Api测试在Yii2中给出错误

Codeception Api测试在Yii2中给出错误,yii2,codeception,Yii2,Codeception,我在api.suite.YML class_name: ApiTester modules: enabled: [PhpBrowser, REST] depends: REST: PhpBrowser config: PhpBrowser: url: 'http://localhost/testapi/' REST: url: 'http://localhost/testa

我在api.suite.YML

class_name: ApiTester
modules:
    enabled: [PhpBrowser, REST]
    depends: 
         REST: PhpBrowser
    config:
        PhpBrowser:
            url: 'http://localhost/testapi/'
        REST:
            url: 'http://localhost/testapi/json/1.0/'
当我使用/vendor/bin/codecept运行时,它给出了以下错误

  [Codeception\Exception\ModuleRequireException]              
  REST module requirements are not met!                       
  This module depends on Codeception\Lib\InnerBrowser         

  Example configuring PhpBrowser as backend for REST module.  
  --                                                          
  modules:                                                    
      enabled: REST:                                          
          depends: PhpBrowser                                 
          url: http://localhost/api/                          
  --                                                          
  Framework modules can be used for testing of API as well.   

我尝试了许多YML配置组合,但没有任何运气。如何解决这个问题?

我也有同样的例外。在做了一些研究之后,if可以通过以下配置解决我的问题:


class_name: ApiTester
modules:
  enabled:
    - REST:
        depends: PhpBrowser
        url: http://127.0.0.1/api/v1/

Yaml文件对空格敏感。因此,您必须注意缩进。

您的配置看起来不错。您是否尝试过运行
codecept build
?是。。我已经试过了。