Skip to content

Commit 907f280

Browse files
committed
chore: fix merge mistake
1 parent afa7637 commit 907f280

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/Codeception/Lib/Connector/Yii2.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,16 @@
1515
use Symfony\Component\BrowserKit\CookieJar;
1616
use Symfony\Component\BrowserKit\History;
1717
use Symfony\Component\BrowserKit\Request as BrowserkitRequest;
18-
use yii\web\Request as YiiRequest;
1918
use Symfony\Component\BrowserKit\Response;
2019
use Yii;
21-
use yii\base\Component;
2220
use yii\base\Event;
2321
use yii\base\ExitException;
2422
use yii\base\Security;
2523
use yii\base\UserException;
2624
use yii\mail\BaseMessage;
27-
use yii\mail\MailEvent;
2825
use yii\web\Application;
29-
use yii\web\ErrorHandler;
3026
use yii\web\IdentityInterface;
31-
use yii\web\Request;
27+
use yii\web\Request as YiiRequest;
3228
use yii\web\Response as YiiResponse;
3329
use yii\web\User;
3430

@@ -308,7 +304,11 @@ public function startApp(?\yii\log\Logger $logger = null): void
308304
}
309305

310306
$config = $this->mockMailer($config);
311-
Yii::$app = Yii::createObject($config);
307+
$app = Yii::createObject($config);
308+
if (!$app instanceof \yii\base\Application) {
309+
throw new ModuleConfigException($this, "Failed to initialize Yii2 app");
310+
}
311+
\Yii::$app = $app;
312312

313313
if ($logger instanceof \yii\log\Logger) {
314314
Yii::setLogger($logger);

src/Codeception/Module/Yii2.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@
2222
use Symfony\Component\BrowserKit\History;
2323
use Yii;
2424
use yii\base\Security;
25-
use yii\web\Application as WebApplication;
2625
use yii\db\ActiveQueryInterface;
2726
use yii\db\ActiveRecordInterface;
2827
use yii\helpers\Url;
2928
use yii\mail\BaseMessage;
3029
use yii\mail\MessageInterface;
3130
use yii\test\Fixture;
32-
use yii\web\Application;
31+
use yii\web\Application as WebApplication;
3332
use yii\web\IdentityInterface;
3433

3534
/**

0 commit comments

Comments
 (0)