Fix #14388: Fixed fixture loading order in output message

This commit is contained in:
Artem Manchenkov
2022-08-29 09:35:54 +02:00
committed by GitHub
parent d6dfca1b80
commit 775e9468cb
2 changed files with 12 additions and 3 deletions

View File

@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.47 under development 2.0.47 under development
------------------------ ------------------------
- Bug #14388: Fixed fixture loading order in output message (manchenkoff)
- Bug #16658: Fix file readability check on publishing assets by `yii\web\AssetManager` (manchenkoff) - Bug #16658: Fix file readability check on publishing assets by `yii\web\AssetManager` (manchenkoff)
- Bug #15557: Fix empty fields exclusion in safe attributes of `yii\base\Model` (manchenkoff) - Bug #15557: Fix empty fields exclusion in safe attributes of `yii\base\Model` (manchenkoff)
- Bug #19508: Fix wrong selection for boolean attributes in GridView (alnidok) - Bug #19508: Fix wrong selection for boolean attributes in GridView (alnidok)

View File

@ -15,6 +15,7 @@ use yii\console\Exception;
use yii\console\ExitCode; use yii\console\ExitCode;
use yii\helpers\Console; use yii\helpers\Console;
use yii\helpers\FileHelper; use yii\helpers\FileHelper;
use yii\test\Fixture;
use yii\test\FixtureTrait; use yii\test\FixtureTrait;
/** /**
@ -157,7 +158,7 @@ class FixtureController extends Controller
$this->unloadFixtures($fixturesObjects); $this->unloadFixtures($fixturesObjects);
$this->loadFixtures($fixturesObjects); $this->loadFixtures($fixturesObjects);
$this->notifyLoaded($fixtures); $this->notifyLoaded($fixturesObjects);
return ExitCode::OK; return ExitCode::OK;
} }
@ -247,13 +248,20 @@ class FixtureController extends Controller
/** /**
* Notifies user that fixtures were successfully loaded. * Notifies user that fixtures were successfully loaded.
* @param array $fixtures * @param Fixture[] $fixtures array of loaded fixtures
*/ */
private function notifyLoaded($fixtures) private function notifyLoaded($fixtures)
{ {
$this->stdout("Fixtures were successfully loaded from namespace:\n", Console::FG_YELLOW); $this->stdout("Fixtures were successfully loaded from namespace:\n", Console::FG_YELLOW);
$this->stdout("\t\"" . Yii::getAlias($this->namespace) . "\"\n\n", Console::FG_GREEN); $this->stdout("\t\"" . Yii::getAlias($this->namespace) . "\"\n\n", Console::FG_GREEN);
$this->outputList($fixtures);
$fixtureClassNames = [];
foreach ($fixtures as $fixture) {
$fixtureClassNames[] = $fixture::className();
}
$this->outputList($fixtureClassNames);
} }
/** /**