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

@ -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);
}
/**