Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
663e898b
Commit
663e898b
authored
Feb 04, 2014
by
Mark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed docs, added checks
parent
cb8fc55a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
console-fixture.md
docs/guide/console-fixture.md
+4
-4
FixtureController.php
framework/console/controllers/FixtureController.php
+7
-3
No files found.
docs/guide/console-fixture.md
View file @
663e898b
...
...
@@ -62,23 +62,23 @@ Below are correct formats of this command:
// load `users` fixture
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
// load several fixtures. Note that there should not be any whitespace between ",", it should be one string.
yii fixture User,UserProfile
// load all fixtures
yii fixture/
apply
all
yii fixture/
load
all
// same as above
yii fixture all
// load fixtures, but for other database connection.
yii fixture
s
User --db='customDbConnectionId'
yii fixture User --db='customDbConnectionId'
// load fixtures, but search them in different namespace. By default namespace is: tests\unit\fixtures.
yii fixture
s
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.
// By default this option is set to `InitDbFixture` to disable/enable integrity checks. You can specify several
...
...
framework/console/controllers/FixtureController.php
View file @
663e898b
...
...
@@ -33,16 +33,16 @@ use yii\test\FixtureTrait;
*
* ~~~
* #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)
* yii fixture User
*
* #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.
* 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>
...
...
@@ -251,8 +251,10 @@ class FixtureController extends Controller
$this
->
stdout
(
"Fixtures namespace is:
\n
"
,
Console
::
FG_YELLOW
);
$this
->
stdout
(
"
\t
"
.
$this
->
namespace
.
"
\n\n
"
,
Console
::
FG_GREEN
);
if
(
count
(
$this
->
globalFixtures
))
{
$this
->
stdout
(
"Global fixtures will be loaded:
\n\n
"
,
Console
::
FG_YELLOW
);
$this
->
outputList
(
$this
->
globalFixtures
);
}
$this
->
stdout
(
"
\n
Fixtures below will be loaded:
\n\n
"
,
Console
::
FG_YELLOW
);
$this
->
outputList
(
$fixtures
);
...
...
@@ -276,8 +278,10 @@ class FixtureController extends Controller
$this
->
stdout
(
"Fixtures namespace is:
\n
"
,
Console
::
FG_YELLOW
);
$this
->
stdout
(
"
\t
"
.
$this
->
namespace
.
"
\n\n
"
,
Console
::
FG_GREEN
);
if
(
count
(
$this
->
globalFixtures
))
{
$this
->
stdout
(
"Global fixtures will be unloaded:
\n\n
"
,
Console
::
FG_YELLOW
);
$this
->
outputList
(
$this
->
globalFixtures
);
}
$this
->
stdout
(
"
\n
Fixtures below will be unloaded:
\n\n
"
,
Console
::
FG_YELLOW
);
$this
->
outputList
(
$fixtures
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment