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
d8669124
Commit
d8669124
authored
Aug 22, 2014
by
Ragazzo
Committed by
Alexander Makarov
Aug 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed console guide and docs of FixtureController
parent
3f597fd4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
11 deletions
+19
-11
test-fixtures.md
docs/guide/test-fixtures.md
+5
-5
tutorial-console.md
docs/guide/tutorial-console.md
+8
-0
FixtureController.php
framework/console/controllers/FixtureController.php
+6
-6
No files found.
docs/guide/test-fixtures.md
View file @
d8669124
...
@@ -305,13 +305,13 @@ yii fixture User UserProfile
...
@@ -305,13 +305,13 @@ yii fixture User UserProfile
yii fixture User --append
yii fixture User --append
// load all fixtures
// load all fixtures
yii fixture/load
*
yii fixture/load
"*"
// same as above
// same as above
yii fixture
*
yii fixture
"*"
// load all fixtures except ones
// load all fixtures except ones
yii fixture
*
-DoNotLoadThisOne
yii fixture
"*"
-DoNotLoadThisOne
// 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 fixture User --namespace='alias\my\custom\namespace'
yii fixture User --namespace='alias\my\custom\namespace'
...
@@ -335,10 +335,10 @@ yii fixture/unload User
...
@@ -335,10 +335,10 @@ yii fixture/unload User
yii fixture/unload User,UserProfile
yii fixture/unload User,UserProfile
// unload all fixtures
// unload all fixtures
yii fixture/unload
all
yii fixture/unload
"*"
// unload all fixtures except ones
// unload all fixtures except ones
yii fixture/unload
all
-DoNotUnloadThisOne
yii fixture/unload
"*"
-DoNotUnloadThisOne
```
```
...
...
docs/guide/tutorial-console.md
View file @
d8669124
...
@@ -77,6 +77,9 @@ file via the `appconfig` option when executing the command:
...
@@ -77,6 +77,9 @@ file via the `appconfig` option when executing the command:
yii <route> --appconfig=path/to/config.php ...
yii <route> --appconfig=path/to/config.php ...
```
```
> Note: When specifying in console commands * as an input argument you should quote as "*", to avoid executing it as a shell command on
some platforms.
Creating your own console commands
Creating your own console commands
----------------------------------
----------------------------------
...
@@ -151,3 +154,8 @@ public function actionIndex()
...
@@ -151,3 +154,8 @@ public function actionIndex()
return
0
;
return
0
;
}
}
```
```
There are some predefined console controller constants for this cases like the following:
-
Controller::EXIT_CODE_NORMAL;
-
Controller::EXIT_CODE_ERROR.
framework/console/controllers/FixtureController.php
View file @
d8669124
...
@@ -25,10 +25,10 @@ use yii\test\FixtureTrait;
...
@@ -25,10 +25,10 @@ use yii\test\FixtureTrait;
* yii fixture User
* yii fixture User
*
*
* #load all fixtures
* #load all fixtures
* yii fixture
*
* yii fixture
"*"
*
*
* #load all fixtures except User
* #load all fixtures except User
* yii fixture
*
-User
* yii fixture
"*"
-User
*
*
* #append fixtures to already loaded
* #append fixtures to already loaded
* yii fixture User --append
* yii fixture User --append
...
@@ -92,10 +92,10 @@ class FixtureController extends Controller
...
@@ -92,10 +92,10 @@ class FixtureController extends Controller
* yii fixture/load --append User UserProfile
* yii fixture/load --append User UserProfile
*
*
* # load all available fixtures found under 'tests\unit\fixtures'
* # load all available fixtures found under 'tests\unit\fixtures'
* yii fixture/load
*
* yii fixture/load
"*"
*
*
* # load all fixtures except User and UserProfile
* # load all fixtures except User and UserProfile
* yii fixture/load
*
-User -UserProfile
* yii fixture/load
"*"
-User -UserProfile
* ~~~
* ~~~
*
*
* @throws Exception if the specified fixture does not exist.
* @throws Exception if the specified fixture does not exist.
...
@@ -164,10 +164,10 @@ class FixtureController extends Controller
...
@@ -164,10 +164,10 @@ class FixtureController extends Controller
* yii fixture/unload User UserProfile
* yii fixture/unload User UserProfile
*
*
* # unload all fixtures found under 'tests\unit\fixtures'
* # unload all fixtures found under 'tests\unit\fixtures'
* yii fixture/unload
*
* yii fixture/unload
"*"
*
*
* # unload all fixtures except User and UserProfile
* # unload all fixtures except User and UserProfile
* yii fixture/unload
*
-User -UserProfile
* yii fixture/unload
"*"
-User -UserProfile
* ~~~
* ~~~
*
*
* @throws Exception if the specified fixture does not exist.
* @throws Exception if the specified fixture does not exist.
...
...
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