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
1ad7e5f7
Commit
1ad7e5f7
authored
Oct 26, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #5508: Dropped the support for the `--append` option for the `fixture` command
parent
7e0a42fc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
22 deletions
+6
-22
test-fixtures.md
docs/guide/test-fixtures.md
+1
-5
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
FixtureController.php
framework/console/controllers/FixtureController.php
+4
-17
No files found.
docs/guide/test-fixtures.md
View file @
1ad7e5f7
...
...
@@ -279,8 +279,7 @@ Loading fixtures
----------------
Fixture classes should be suffixed by
`Fixture`
class. By default fixtures will be searched under
`tests\unit\fixtures`
namespace, you can
change this behavior with config or command options. Note that you can also append fixtures data to already existing ones with command
option
`--append`
. You can exclude some fixtures due load or unload by specifying
`-`
before its name like
`-User`
.
change this behavior with config or command options. You can exclude some fixtures due load or unload by specifying
`-`
before its name like
`-User`
.
To load fixture, run the following command:
...
...
@@ -301,9 +300,6 @@ yii fixture User
// load several fixtures
yii fixture User UserProfile
//load fixture, but don't clean storage before load and just append to already existed data
yii fixture User --append
// load all fixtures
yii fixture/load "*"
...
...
framework/CHANGELOG.md
View file @
1ad7e5f7
...
...
@@ -26,6 +26,7 @@ Yii Framework 2 Change Log
-
Enh #5735: Added
`yii\bootstrap\Tabs::renderTabContent`
to support manually rendering tab contents (RomeroMsk)
-
Enh:
`Console::confirm()`
now uses
`Console::stdout()`
instead of
`echo`
to be consistent with all other functions (cebe)
-
Chg #3630:
`yii\db\Command::queryInternal()`
is now protected (samdark)
-
Chg #5508: Dropped the support for the
`--append`
option for the
`fixture`
command (qiangxue)
2.
0.0 October 12, 2014
----------------------
...
...
framework/console/controllers/FixtureController.php
View file @
1ad7e5f7
...
...
@@ -30,9 +30,6 @@ use yii\test\FixtureTrait;
* #load all fixtures except User
* yii fixture "*" -User
*
* #append fixtures to already loaded
* yii fixture User --append
*
* #load fixtures with different namespace.
* yii fixture/load User --namespace=alias\my\custom\namespace\goes\here
* ~~~
...
...
@@ -55,11 +52,6 @@ class FixtureController extends Controller
*/
public
$namespace
=
'tests\unit\fixtures'
;
/**
* @var boolean whether to append new fixture data to the existing ones.
* Defaults to false, meaning if there is any existing fixture data, it will be removed.
*/
public
$append
=
false
;
/**
* @var array global fixtures that should be applied when loading and unloading. By default it is set to `InitDbFixture`
* that disables and enables integrity check, so your data can be safely loaded.
*/
...
...
@@ -74,7 +66,7 @@ class FixtureController extends Controller
public
function
options
(
$actionID
)
{
return
array_merge
(
parent
::
options
(
$actionID
),
[
'namespace'
,
'globalFixtures'
,
'append'
'namespace'
,
'globalFixtures'
]);
}
...
...
@@ -87,10 +79,6 @@ class FixtureController extends Controller
* # any existing fixture data will be removed first
* yii fixture/load User UserProfile
*
* # load the fixture data specified by User and UserProfile.
* # the new fixture data will be appended to the existing one
* yii fixture/load --append User UserProfile
*
* # load all available fixtures found under 'tests\unit\fixtures'
* yii fixture/load "*"
*
...
...
@@ -100,7 +88,7 @@ class FixtureController extends Controller
*
* @throws Exception if the specified fixture does not exist.
*/
public
function
actionLoad
(
$fixturesInput
)
public
function
actionLoad
()
{
$fixturesInput
=
func_get_args
();
$filtered
=
$this
->
filterFixtures
(
$fixturesInput
);
...
...
@@ -147,12 +135,11 @@ class FixtureController extends Controller
$fixturesObjects
=
$this
->
createFixtures
(
$fixtures
);
if
(
!
$this
->
append
)
{
$this
->
unloadFixtures
(
$fixturesObjects
);
}
$this
->
loadFixtures
(
$fixturesObjects
);
$this
->
notifyLoaded
(
$fixtures
);
return
static
::
EXIT_CODE_NORMAL
;
}
/**
...
...
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