mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 06:11:35 +08:00
Fix #14388: Fixed fixture loading order in output message
This commit is contained in:
@ -15,6 +15,7 @@ use yii\console\Exception;
|
||||
use yii\console\ExitCode;
|
||||
use yii\helpers\Console;
|
||||
use yii\helpers\FileHelper;
|
||||
use yii\test\Fixture;
|
||||
use yii\test\FixtureTrait;
|
||||
|
||||
/**
|
||||
@ -157,7 +158,7 @@ class FixtureController extends Controller
|
||||
|
||||
$this->unloadFixtures($fixturesObjects);
|
||||
$this->loadFixtures($fixturesObjects);
|
||||
$this->notifyLoaded($fixtures);
|
||||
$this->notifyLoaded($fixturesObjects);
|
||||
|
||||
return ExitCode::OK;
|
||||
}
|
||||
@ -247,13 +248,20 @@ class FixtureController extends Controller
|
||||
|
||||
/**
|
||||
* Notifies user that fixtures were successfully loaded.
|
||||
* @param array $fixtures
|
||||
* @param Fixture[] $fixtures array of loaded fixtures
|
||||
*/
|
||||
private function notifyLoaded($fixtures)
|
||||
{
|
||||
$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->outputList($fixtures);
|
||||
|
||||
$fixtureClassNames = [];
|
||||
|
||||
foreach ($fixtures as $fixture) {
|
||||
$fixtureClassNames[] = $fixture::className();
|
||||
}
|
||||
|
||||
$this->outputList($fixtureClassNames);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user