diff --git a/tests/framework/web/DbSessionTest.php b/tests/framework/web/DbSessionTest.php index 61a6b8fa9f..1c5f77d7d9 100644 --- a/tests/framework/web/DbSessionTest.php +++ b/tests/framework/web/DbSessionTest.php @@ -120,7 +120,10 @@ class DbSessionTest extends TestCase ] ], ]); - + + $consoleClass = Yii::$classMap['yii\helpers\Console']; + Yii::$classMap['yii\helpers\Console'] = Yii::getAlias('@yiiunit/framework/web/mocks/ConsoleMock.php'); + $history = $this->runMigrate('history'); $this->assertEquals(['base'], $history); @@ -129,5 +132,7 @@ class DbSessionTest extends TestCase $history = $this->runMigrate('down'); $this->assertEquals(['base'], $history); + + Yii::$classMap['yii\helpers\Console'] = $consoleClass; } } diff --git a/tests/framework/web/mocks/ConsoleMock.php b/tests/framework/web/mocks/ConsoleMock.php new file mode 100644 index 0000000000..22592c4a28 --- /dev/null +++ b/tests/framework/web/mocks/ConsoleMock.php @@ -0,0 +1,34 @@ +