10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d702f93 commit 77892d8Copy full SHA for 77892d8
src/Codeception/Test/Unit.php
@@ -78,12 +78,11 @@ protected function _setUp()
78
$di = $metadata->getService('di');
79
80
// Auto-inject $tester property
81
- if ($actor = $metadata->getCurrent('actor')) {
82
- $suffix = (string) Configuration::config()['actor_suffix'];
83
- $property = lcfirst($suffix);
84
- if (property_exists($this, $property)) {
85
- $this->{$property} = $di->instantiate($actor);
86
- }
+ if (
+ ($actor = $this->getMetadata()->getCurrent('actor')) &&
+ ($property = lcfirst((string) Configuration::config()['actor_suffix']))
+ ) {
+ $this->{$property} = $di->instantiate($actor);
87
}
88
89
$this->scenario = $di->get(Scenario::class);
0 commit comments