Codeception / Codeception/AspectMock
How can i past a double to a class contructor?
未关闭
- 主要语言
- PHP
- 星标
- 784
- 派生
- 132
- PR 合并指标
- 30 天内没有已合并 PR
描述
the following doesnt' work
```
$ck = test::double(CacheKey::class, [ 'track' => null,])->make();
$cityConfigProvider = new CityConfigProvider($cityConfigBuilder, $ck); // failed for $ck is not an instance of CacheKey
$ck->verifyInvoked('track');
$value = $cityConfigProvider->get($cityId, 'wechat_app_Id');
```
贡献指南
这个仓库没有索引到贡献指南
调研方向
Start by reproducing the shown test::double(CacheKey::class, ...) setup and the CityConfigProvider constructor call. Inspect how the mocking framework creates doubles for class types; done means the injected $ck is accepted as a CacheKey instance and verifyInvoked('track') works.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- php
- 领域
- testing-qa
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 30/100