Closed usjstb closed 5 years ago
@usjstb Swoft\\App::getAppProperties()
must be an instance of Swoft\\Core\\Config
, null
returned,从报错上来看是你的配置没能返回
@usjstb
Swoft\\App::getAppProperties()
must be an instance ofSwoft\\Core\\Config
,null
returned,从报错上来看是你的配置没能返回
我直接访问写的这个接口时,是正常运行的;但是在单元测试中就出现了这种问题。 是单元测试中,以命令行方式运行时配置加载方式有什么不同吗?需要对配置文件做怎样的修改吗?
单元测试的不会加载 ./config 内的配置的,只会加载 ./test/config 内的
@usjstb 2.0已发布,建议升级到2.0
Details
/var/www/swoft/vendor/swoft/component/src/http-message/src/Testing/Base/ResponseAssertTrait.php:199 /var/www/swoft/test/Cases/bill/BillTest.php:20
接口不调用Service就可以测试通过。
之前使用非dev版本时,是另一种报错,看到有解决 https://github.com/swoft-cloud/swoft-component/pull/155
就升级到dev版本,但发现出现了新的这个报错。