Commit 663e898b by Mark

fixed docs, added checks

parent cb8fc55a
...@@ -62,23 +62,23 @@ Below are correct formats of this command: ...@@ -62,23 +62,23 @@ Below are correct formats of this command:
// load `users` fixture // load `users` fixture
yii fixture/load User yii fixture/load User
// same as above, because default action of "fixture" command is "apply" // same as above, because default action of "fixture" command is "load"
yii fixture User yii fixture User
// load several fixtures. Note that there should not be any whitespace between ",", it should be one string. // load several fixtures. Note that there should not be any whitespace between ",", it should be one string.
yii fixture User,UserProfile yii fixture User,UserProfile
// load all fixtures // load all fixtures
yii fixture/apply all yii fixture/load all
// same as above // same as above
yii fixture all yii fixture all
// load fixtures, but for other database connection. // load fixtures, but for other database connection.
yii fixtures User --db='customDbConnectionId' yii fixture User --db='customDbConnectionId'
// load fixtures, but search them in different namespace. By default namespace is: tests\unit\fixtures. // load fixtures, but search them in different namespace. By default namespace is: tests\unit\fixtures.
yii fixtures User --namespace='alias\my\custom\namespace' yii fixture User --namespace='alias\my\custom\namespace'
// load global fixture `some\name\space\CustomFixture` before other fixtures will be loaded. // load global fixture `some\name\space\CustomFixture` before other fixtures will be loaded.
// By default this option is set to `InitDbFixture` to disable/enable integrity checks. You can specify several // By default this option is set to `InitDbFixture` to disable/enable integrity checks. You can specify several
......
...@@ -33,16 +33,16 @@ use yii\test\FixtureTrait; ...@@ -33,16 +33,16 @@ use yii\test\FixtureTrait;
* *
* ~~~ * ~~~
* #load fixtures under $fixturePath from UsersFixture class with default namespace "tests\unit\fixtures" * #load fixtures under $fixturePath from UsersFixture class with default namespace "tests\unit\fixtures"
* yii fixture/apply User * yii fixture/load User
* *
* #also a short version of this command (generate action is default) * #also a short version of this command (generate action is default)
* yii fixture User * yii fixture User
* *
* #load fixtures under $fixturePath with the different database connection * #load fixtures under $fixturePath with the different database connection
* yii fixture/apply User --db=someOtherDbConnection * yii fixture/load User --db=someOtherDbConnection
* *
* #load fixtures under different $fixturePath. * #load fixtures under different $fixturePath.
* yii fixture/apply User --namespace=alias\my\custom\namespace\goes\here * yii fixture/load User --namespace=alias\my\custom\namespace\goes\here
* ~~~ * ~~~
* *
* @author Mark Jebri <mark.github@yandex.ru> * @author Mark Jebri <mark.github@yandex.ru>
...@@ -251,8 +251,10 @@ class FixtureController extends Controller ...@@ -251,8 +251,10 @@ class FixtureController extends Controller
$this->stdout("Fixtures namespace is: \n", Console::FG_YELLOW); $this->stdout("Fixtures namespace is: \n", Console::FG_YELLOW);
$this->stdout("\t" . $this->namespace . "\n\n", Console::FG_GREEN); $this->stdout("\t" . $this->namespace . "\n\n", Console::FG_GREEN);
$this->stdout("Global fixtures will be loaded:\n\n", Console::FG_YELLOW); if (count($this->globalFixtures)) {
$this->outputList($this->globalFixtures); $this->stdout("Global fixtures will be loaded:\n\n", Console::FG_YELLOW);
$this->outputList($this->globalFixtures);
}
$this->stdout("\nFixtures below will be loaded:\n\n", Console::FG_YELLOW); $this->stdout("\nFixtures below will be loaded:\n\n", Console::FG_YELLOW);
$this->outputList($fixtures); $this->outputList($fixtures);
...@@ -276,8 +278,10 @@ class FixtureController extends Controller ...@@ -276,8 +278,10 @@ class FixtureController extends Controller
$this->stdout("Fixtures namespace is: \n", Console::FG_YELLOW); $this->stdout("Fixtures namespace is: \n", Console::FG_YELLOW);
$this->stdout("\t" . $this->namespace . "\n\n", Console::FG_GREEN); $this->stdout("\t" . $this->namespace . "\n\n", Console::FG_GREEN);
$this->stdout("Global fixtures will be unloaded:\n\n", Console::FG_YELLOW); if (count($this->globalFixtures)) {
$this->outputList($this->globalFixtures); $this->stdout("Global fixtures will be unloaded:\n\n", Console::FG_YELLOW);
$this->outputList($this->globalFixtures);
}
$this->stdout("\nFixtures below will be unloaded:\n\n", Console::FG_YELLOW); $this->stdout("\nFixtures below will be unloaded:\n\n", Console::FG_YELLOW);
$this->outputList($fixtures); $this->outputList($fixtures);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment