mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 06:11:35 +08:00
Fixes #5508: Dropped the support for the --append
option for the fixture
command
This commit is contained in:
@ -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
|
||||
* ~~~
|
||||
@ -54,11 +51,6 @@ class FixtureController extends Controller
|
||||
* @var string default namespace to search fixtures in
|
||||
*/
|
||||
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->unloadFixtures($fixturesObjects);
|
||||
$this->loadFixtures($fixturesObjects);
|
||||
$this->notifyLoaded($fixtures);
|
||||
|
||||
return static::EXIT_CODE_NORMAL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user