Codeception / Codeception/AspectMock
How can i past a double to a class contructor?
- Langage dominant
- PHP
- Étoiles
- 784
- Forks
- 132
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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');
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- php
- Domaine
- testing-qa
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 30/100