Skip to content

Commit c1298a8

Browse files
bscheshirworksamdark
authored andcommitted
Use Yii DI for resolve any upgrade on record class (#4763)
1 parent bf51d41 commit c1298a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Codeception/Module/Yii2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ protected function getModelRecord($model)
486486
if (!class_exists($model)) {
487487
throw new \RuntimeException("Model $model does not exist");
488488
}
489-
$record = new $model;
489+
$record = Yii::createObject($model);
490490
if (!$record instanceof ActiveRecordInterface) {
491491
throw new \RuntimeException("Model $model is not implement interface \\yii\\db\\ActiveRecordInterface");
492492
}

0 commit comments

Comments
 (0)