mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
Fixes #11683: Fixed fixture command to work with short syntax. yii fixture "*, -User"
should be used instead of yii fixture "*" -User
This commit is contained in:

committed by
Alexander Makarov

parent
326cdfeb52
commit
8c240ed067
@ -310,7 +310,7 @@ yii fixture/load User
|
|||||||
yii fixture User
|
yii fixture User
|
||||||
|
|
||||||
// carga varios fixtures
|
// carga varios fixtures
|
||||||
yii fixture User UserProfile
|
yii fixture "User, UserProfile"
|
||||||
|
|
||||||
// carga todos los fixtures
|
// carga todos los fixtures
|
||||||
yii fixture/load "*"
|
yii fixture/load "*"
|
||||||
@ -319,7 +319,7 @@ yii fixture/load "*"
|
|||||||
yii fixture "*"
|
yii fixture "*"
|
||||||
|
|
||||||
// carga todos los fixtures excepto uno
|
// carga todos los fixtures excepto uno
|
||||||
yii fixture "*" -DoNotLoadThisOne
|
yii fixture "*, -DoNotLoadThisOne"
|
||||||
|
|
||||||
// carga fixtures, pero los busca en diferente espacio de nombre. El espacio de nombre por defecto es: tests\unit\fixtures.
|
// carga fixtures, pero los busca en diferente espacio de nombre. El espacio de nombre por defecto es: tests\unit\fixtures.
|
||||||
yii fixture User --namespace='alias\my\custom\namespace'
|
yii fixture User --namespace='alias\my\custom\namespace'
|
||||||
@ -340,13 +340,13 @@ Para descargar un fixture, ejecuta el siguiente comando:
|
|||||||
yii fixture/unload User
|
yii fixture/unload User
|
||||||
|
|
||||||
// descarga varios fixtures
|
// descarga varios fixtures
|
||||||
yii fixture/unload User,UserProfile
|
yii fixture/unload "User, UserProfile"
|
||||||
|
|
||||||
// descarga todos los fixtures
|
// descarga todos los fixtures
|
||||||
yii fixture/unload "*"
|
yii fixture/unload "*"
|
||||||
|
|
||||||
// descarga todos los fixtures excepto uno
|
// descarga todos los fixtures excepto uno
|
||||||
yii fixture/unload "*" -DoNotUnloadThisOne
|
yii fixture/unload "*, -DoNotUnloadThisOne"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ yii fixture/load User
|
|||||||
yii fixture User
|
yii fixture User
|
||||||
|
|
||||||
// load several fixtures
|
// load several fixtures
|
||||||
yii fixture User UserProfile
|
yii fixture "User, UserProfile"
|
||||||
|
|
||||||
// load all fixtures
|
// load all fixtures
|
||||||
yii fixture/load "*"
|
yii fixture/load "*"
|
||||||
@ -316,7 +316,7 @@ yii fixture/load "*"
|
|||||||
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'
|
||||||
@ -337,13 +337,13 @@ To unload fixture, run the following command:
|
|||||||
yii fixture/unload User
|
yii fixture/unload User
|
||||||
|
|
||||||
// Unload several fixtures
|
// Unload several fixtures
|
||||||
yii fixture/unload User,UserProfile
|
yii fixture/unload "User, UserProfile"
|
||||||
|
|
||||||
// unload all fixtures
|
// unload all fixtures
|
||||||
yii fixture/unload "*"
|
yii fixture/unload "*"
|
||||||
|
|
||||||
// unload all fixtures except ones
|
// unload all fixtures except ones
|
||||||
yii fixture/unload "*" -DoNotUnloadThisOne
|
yii fixture/unload "*, -DoNotUnloadThisOne"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ yii fixture/load User
|
|||||||
yii fixture User
|
yii fixture User
|
||||||
|
|
||||||
// загрузить нескольких фикстур
|
// загрузить нескольких фикстур
|
||||||
yii fixture User UserProfile
|
yii fixture "User, UserProfile"
|
||||||
|
|
||||||
// загрузить все фикстуры
|
// загрузить все фикстуры
|
||||||
yii fixture/load "*"
|
yii fixture/load "*"
|
||||||
@ -321,7 +321,7 @@ yii fixture/load "*"
|
|||||||
yii fixture "*"
|
yii fixture "*"
|
||||||
|
|
||||||
// загрузить все фикстуры кроме указанной
|
// загрузить все фикстуры кроме указанной
|
||||||
yii fixture "*" -DoNotLoadThisOne
|
yii fixture "*, -DoNotLoadThisOne"
|
||||||
|
|
||||||
// загрузка фикстур, но искать их следует в другом пространстве имен. Пространство имен по умолчанию: tests\unit\fixtures.
|
// загрузка фикстур, но искать их следует в другом пространстве имен. Пространство имен по умолчанию: tests\unit\fixtures.
|
||||||
yii fixture User --namespace='alias\my\custom\namespace'
|
yii fixture User --namespace='alias\my\custom\namespace'
|
||||||
@ -342,13 +342,13 @@ yii fixture User --globalFixtures='some\name\space\Custom'
|
|||||||
yii fixture/unload User
|
yii fixture/unload User
|
||||||
|
|
||||||
// выгрузить несколько фикстур
|
// выгрузить несколько фикстур
|
||||||
yii fixture/unload User,UserProfile
|
yii fixture/unload "User, UserProfile"
|
||||||
|
|
||||||
// выгрузить все фикстуры
|
// выгрузить все фикстуры
|
||||||
yii fixture/unload "*"
|
yii fixture/unload "*"
|
||||||
|
|
||||||
// выгрузить все фикстуры за исключением указанной
|
// выгрузить все фикстуры за исключением указанной
|
||||||
yii fixture/unload "*" -DoNotUnloadThisOne
|
yii fixture/unload "*, -DoNotUnloadThisOne"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ yii fixture/load User
|
|||||||
yii fixture User
|
yii fixture User
|
||||||
|
|
||||||
// load several fixtures
|
// load several fixtures
|
||||||
yii fixture User UserProfile
|
yii fixture "User, UserProfile"
|
||||||
|
|
||||||
// load all fixtures
|
// load all fixtures
|
||||||
yii fixture/load "*"
|
yii fixture/load "*"
|
||||||
@ -319,7 +319,7 @@ yii fixture/load "*"
|
|||||||
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'
|
||||||
@ -340,13 +340,13 @@ To unload fixture, run the following command:
|
|||||||
yii fixture/unload User
|
yii fixture/unload User
|
||||||
|
|
||||||
// Unload several fixtures
|
// Unload several fixtures
|
||||||
yii fixture/unload User,UserProfile
|
yii fixture/unload "User, UserProfile"
|
||||||
|
|
||||||
// unload all fixtures
|
// unload all fixtures
|
||||||
yii fixture/unload "*"
|
yii fixture/unload "*"
|
||||||
|
|
||||||
// unload all fixtures except ones
|
// unload all fixtures except ones
|
||||||
yii fixture/unload "*" -DoNotUnloadThisOne
|
yii fixture/unload "*, -DoNotUnloadThisOne"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ Yii Framework 2 Change Log
|
|||||||
- Bug #11322: Fixed incorrect error message in `yii\validators\UniqueValidator` for composite `targetAttribute` (PowerGamer1, silverfire, cebe)
|
- Bug #11322: Fixed incorrect error message in `yii\validators\UniqueValidator` for composite `targetAttribute` (PowerGamer1, silverfire, cebe)
|
||||||
- Chg #11364: Updated jQuery dependency to include versions `1.12.*` (cebe)
|
- Chg #11364: Updated jQuery dependency to include versions `1.12.*` (cebe)
|
||||||
- Bug #11252: Use strict comparison on ActiveRecord::hasAttribute() to avoid cases where it returns true when a number is passed to it (Faryshta)
|
- Bug #11252: Use strict comparison on ActiveRecord::hasAttribute() to avoid cases where it returns true when a number is passed to it (Faryshta)
|
||||||
|
- Chg #11683: Fixed fixture command to work with short syntax. `yii fixture "*, -User"` should be used instead of `yii fixture "*" -User` (Faryshta, samdark)
|
||||||
|
|
||||||
|
|
||||||
2.0.8 April 28, 2016
|
2.0.8 April 28, 2016
|
||||||
|
@ -20,6 +20,8 @@ Upgrade from Yii 2.0.8
|
|||||||
|
|
||||||
* Part of code from `yii\web\User::loginByCookie()` method was moved to new `getIdentityAndDurationFromCookie()`
|
* Part of code from `yii\web\User::loginByCookie()` method was moved to new `getIdentityAndDurationFromCookie()`
|
||||||
and `removeIdentityCookie()` methods. If you override `loginByCookie()` method, update it in order use new methods.
|
and `removeIdentityCookie()` methods. If you override `loginByCookie()` method, update it in order use new methods.
|
||||||
|
* Fixture console command syntax was changed from `yii fixture "*" -User` to `yii fixture "*, -User"`. Upgrade your
|
||||||
|
scripts if necessary.
|
||||||
|
|
||||||
Upgrade from Yii 2.0.7
|
Upgrade from Yii 2.0.7
|
||||||
----------------------
|
----------------------
|
||||||
|
@ -28,7 +28,7 @@ use yii\test\FixtureTrait;
|
|||||||
* yii fixture "*"
|
* yii fixture "*"
|
||||||
*
|
*
|
||||||
* #load all fixtures except User
|
* #load all fixtures except User
|
||||||
* yii fixture "*" -User
|
* yii fixture "*, -User"
|
||||||
*
|
*
|
||||||
* #load fixtures with different namespace.
|
* #load fixtures with different namespace.
|
||||||
* yii fixture/load User --namespace=alias\my\custom\namespace\goes\here
|
* yii fixture/load User --namespace=alias\my\custom\namespace\goes\here
|
||||||
@ -89,20 +89,19 @@ class FixtureController extends Controller
|
|||||||
* ```
|
* ```
|
||||||
* # load the fixture data specified by User and UserProfile.
|
* # load the fixture data specified by User and UserProfile.
|
||||||
* # any existing fixture data will be removed first
|
* # any existing fixture data will be removed first
|
||||||
* yii fixture/load User UserProfile
|
* yii fixture/load "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.
|
||||||
*/
|
*/
|
||||||
public function actionLoad()
|
public function actionLoad(array $fixturesInput = [])
|
||||||
{
|
{
|
||||||
$fixturesInput = func_get_args();
|
|
||||||
if ($fixturesInput === []) {
|
if ($fixturesInput === []) {
|
||||||
$this->stdout($this->getHelpSummary() . "\n");
|
$this->stdout($this->getHelpSummary() . "\n");
|
||||||
|
|
||||||
@ -116,7 +115,6 @@ class FixtureController extends Controller
|
|||||||
$except = $filtered['except'];
|
$except = $filtered['except'];
|
||||||
|
|
||||||
if (!$this->needToApplyAll($fixturesInput[0])) {
|
if (!$this->needToApplyAll($fixturesInput[0])) {
|
||||||
|
|
||||||
$fixtures = $filtered['apply'];
|
$fixtures = $filtered['apply'];
|
||||||
|
|
||||||
$foundFixtures = $this->findFixtures($fixtures);
|
$foundFixtures = $this->findFixtures($fixtures);
|
||||||
@ -125,7 +123,6 @@ class FixtureController extends Controller
|
|||||||
if ($notFoundFixtures) {
|
if ($notFoundFixtures) {
|
||||||
$this->notifyNotFound($notFoundFixtures);
|
$this->notifyNotFound($notFoundFixtures);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$foundFixtures = $this->findFixtures();
|
$foundFixtures = $this->findFixtures();
|
||||||
}
|
}
|
||||||
@ -134,8 +131,8 @@ class FixtureController extends Controller
|
|||||||
|
|
||||||
if (!$foundFixtures) {
|
if (!$foundFixtures) {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
"No files were found by name: \"" . implode(', ', $fixturesInput) . "\".\n" .
|
"No files were found for: \"" . implode(', ', $fixturesInput) . "\".\n" .
|
||||||
"Check that files with these name exists, under fixtures path: \n\"" . $this->getFixturePath() . "\"."
|
"Check that files exist under fixtures path: \n\"" . $this->getFixturePath() . "\"."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,25 +166,23 @@ class FixtureController extends Controller
|
|||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* # unload the fixture data specified by User and UserProfile.
|
* # unload the fixture data specified by User and UserProfile.
|
||||||
* 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.
|
||||||
*/
|
*/
|
||||||
public function actionUnload()
|
public function actionUnload(array $fixturesInput = [])
|
||||||
{
|
{
|
||||||
$fixturesInput = func_get_args();
|
|
||||||
$filtered = $this->filterFixtures($fixturesInput);
|
$filtered = $this->filterFixtures($fixturesInput);
|
||||||
$except = $filtered['except'];
|
$except = $filtered['except'];
|
||||||
|
|
||||||
if (!$this->needToApplyAll($fixturesInput[0])) {
|
if (!$this->needToApplyAll($fixturesInput[0])) {
|
||||||
|
|
||||||
$fixtures = $filtered['apply'];
|
$fixtures = $filtered['apply'];
|
||||||
|
|
||||||
$foundFixtures = $this->findFixtures($fixtures);
|
$foundFixtures = $this->findFixtures($fixtures);
|
||||||
@ -196,7 +191,6 @@ class FixtureController extends Controller
|
|||||||
if ($notFoundFixtures) {
|
if ($notFoundFixtures) {
|
||||||
$this->notifyNotFound($notFoundFixtures);
|
$this->notifyNotFound($notFoundFixtures);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$foundFixtures = $this->findFixtures();
|
$foundFixtures = $this->findFixtures();
|
||||||
}
|
}
|
||||||
@ -205,8 +199,8 @@ class FixtureController extends Controller
|
|||||||
|
|
||||||
if (!$foundFixtures) {
|
if (!$foundFixtures) {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
"No files were found by name: \"" . implode(', ', $fixturesInput) . "\".\n" .
|
"No files were found for: \"" . implode(', ', $fixturesInput) . "\".\n" .
|
||||||
"Check that files with these name exists, under fixtures path: \n\"" . $this->getFixturePath() . "\"."
|
"Check that files exist under fixtures path: \n\"" . $this->getFixturePath() . "\"."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,12 +263,12 @@ class FixtureController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function notifyNothingToUnload($foundFixtures, $except)
|
public function notifyNothingToUnload($foundFixtures, $except)
|
||||||
{
|
{
|
||||||
$this->stdout("Fixtures to unload could not be found according given conditions:\n\n", Console::FG_RED);
|
$this->stdout("Fixtures to unload could not be found according to given conditions:\n\n", Console::FG_RED);
|
||||||
$this->stdout("Fixtures namespace is: \n", Console::FG_YELLOW);
|
$this->stdout("Fixtures namespace is: \n", Console::FG_YELLOW);
|
||||||
$this->stdout("\t" . $this->namespace . "\n", Console::FG_GREEN);
|
$this->stdout("\t" . $this->namespace . "\n", Console::FG_GREEN);
|
||||||
|
|
||||||
if (count($foundFixtures)) {
|
if (count($foundFixtures)) {
|
||||||
$this->stdout("\nFixtures founded under the namespace:\n\n", Console::FG_YELLOW);
|
$this->stdout("\nFixtures found under the namespace:\n\n", Console::FG_YELLOW);
|
||||||
$this->outputList($foundFixtures);
|
$this->outputList($foundFixtures);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,7 +398,6 @@ class FixtureController extends Controller
|
|||||||
$findAll = ($fixtures === []);
|
$findAll = ($fixtures === []);
|
||||||
|
|
||||||
if (!$findAll) {
|
if (!$findAll) {
|
||||||
|
|
||||||
$filesToSearch = [];
|
$filesToSearch = [];
|
||||||
|
|
||||||
foreach ($fixtures as $fileName) {
|
foreach ($fixtures as $fileName) {
|
||||||
@ -432,7 +425,6 @@ class FixtureController extends Controller
|
|||||||
$config = [];
|
$config = [];
|
||||||
|
|
||||||
foreach ($fixtures as $fixture) {
|
foreach ($fixtures as $fixture) {
|
||||||
|
|
||||||
$isNamespaced = (strpos($fixture, '\\') !== false);
|
$isNamespaced = (strpos($fixture, '\\') !== false);
|
||||||
$fullClassName = $isNamespaced ? $fixture . 'Fixture' : $this->namespace . '\\' . $fixture . 'Fixture';
|
$fullClassName = $isNamespaced ? $fixture . 'Fixture' : $this->namespace . '\\' . $fixture . 'Fixture';
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class FixtureControllerTest extends TestCase
|
|||||||
'\yiiunit\data\console\controllers\fixtures\Global'
|
'\yiiunit\data\console\controllers\fixtures\Global'
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->_fixtureController->actionLoad('First');
|
$this->_fixtureController->actionLoad(['First']);
|
||||||
|
|
||||||
$this->assertCount(1, FixtureStorage::$globalFixturesData, 'global fixture data should be loaded');
|
$this->assertCount(1, FixtureStorage::$globalFixturesData, 'global fixture data should be loaded');
|
||||||
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
||||||
@ -65,7 +65,7 @@ class FixtureControllerTest extends TestCase
|
|||||||
$this->assertCount(1, FixtureStorage::$globalFixturesData, 'global fixture data should be loaded');
|
$this->assertCount(1, FixtureStorage::$globalFixturesData, 'global fixture data should be loaded');
|
||||||
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
||||||
|
|
||||||
$this->_fixtureController->actionUnload('First');
|
$this->_fixtureController->actionUnload(['First']);
|
||||||
|
|
||||||
$this->assertEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should be unloaded');
|
$this->assertEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should be unloaded');
|
||||||
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should be unloaded');
|
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should be unloaded');
|
||||||
@ -77,7 +77,7 @@ class FixtureControllerTest extends TestCase
|
|||||||
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should be empty');
|
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should be empty');
|
||||||
$this->assertEmpty(FixtureStorage::$secondFixtureData, 'second fixture data should be empty');
|
$this->assertEmpty(FixtureStorage::$secondFixtureData, 'second fixture data should be empty');
|
||||||
|
|
||||||
$this->_fixtureController->actionLoad('*');
|
$this->_fixtureController->actionLoad(['*']);
|
||||||
|
|
||||||
$this->assertCount(1, FixtureStorage::$globalFixturesData, 'global fixture data should be loaded');
|
$this->assertCount(1, FixtureStorage::$globalFixturesData, 'global fixture data should be loaded');
|
||||||
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
||||||
@ -94,7 +94,7 @@ class FixtureControllerTest extends TestCase
|
|||||||
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
||||||
$this->assertCount(1, FixtureStorage::$secondFixtureData, 'second fixture data should be loaded');
|
$this->assertCount(1, FixtureStorage::$secondFixtureData, 'second fixture data should be loaded');
|
||||||
|
|
||||||
$this->_fixtureController->actionUnload('*');
|
$this->_fixtureController->actionUnload(['*']);
|
||||||
|
|
||||||
$this->assertEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should be unloaded');
|
$this->assertEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should be unloaded');
|
||||||
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should be unloaded');
|
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should be unloaded');
|
||||||
@ -103,7 +103,7 @@ class FixtureControllerTest extends TestCase
|
|||||||
|
|
||||||
public function testLoadParticularExceptOnes()
|
public function testLoadParticularExceptOnes()
|
||||||
{
|
{
|
||||||
$this->_fixtureController->actionLoad('First', '-Second', '-Global');
|
$this->_fixtureController->actionLoad(['First', '-Second', '-Global']);
|
||||||
|
|
||||||
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
||||||
$this->assertEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should not be loaded');
|
$this->assertEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should not be loaded');
|
||||||
@ -116,7 +116,11 @@ class FixtureControllerTest extends TestCase
|
|||||||
FixtureStorage::$firstFixtureData[] = 'some seeded first fixture data';
|
FixtureStorage::$firstFixtureData[] = 'some seeded first fixture data';
|
||||||
FixtureStorage::$secondFixtureData[] = 'some seeded second fixture data';
|
FixtureStorage::$secondFixtureData[] = 'some seeded second fixture data';
|
||||||
|
|
||||||
$this->_fixtureController->actionUnload('First', '-Second', '-Global');
|
$this->_fixtureController->actionUnload([
|
||||||
|
'First',
|
||||||
|
'-Second',
|
||||||
|
'-Global',
|
||||||
|
]);
|
||||||
|
|
||||||
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should be unloaded');
|
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should be unloaded');
|
||||||
$this->assertNotEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should not be unloaded');
|
$this->assertNotEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should not be unloaded');
|
||||||
@ -125,7 +129,7 @@ class FixtureControllerTest extends TestCase
|
|||||||
|
|
||||||
public function testLoadAllExceptOnes()
|
public function testLoadAllExceptOnes()
|
||||||
{
|
{
|
||||||
$this->_fixtureController->actionLoad('*', '-Second', '-Global');
|
$this->_fixtureController->actionLoad(['*', '-Second', '-Global']);
|
||||||
|
|
||||||
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
$this->assertCount(1, FixtureStorage::$firstFixtureData, 'first fixture data should be loaded');
|
||||||
$this->assertEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should not be loaded');
|
$this->assertEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should not be loaded');
|
||||||
@ -138,7 +142,7 @@ class FixtureControllerTest extends TestCase
|
|||||||
FixtureStorage::$firstFixtureData[] = 'some seeded first fixture data';
|
FixtureStorage::$firstFixtureData[] = 'some seeded first fixture data';
|
||||||
FixtureStorage::$secondFixtureData[] = 'some seeded second fixture data';
|
FixtureStorage::$secondFixtureData[] = 'some seeded second fixture data';
|
||||||
|
|
||||||
$this->_fixtureController->actionUnload('*', '-Second', '-Global');
|
$this->_fixtureController->actionUnload(['*', '-Second', '-Global']);
|
||||||
|
|
||||||
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should be unloaded');
|
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should be unloaded');
|
||||||
$this->assertNotEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should not be unloaded');
|
$this->assertNotEmpty(FixtureStorage::$globalFixturesData, 'global fixture data should not be unloaded');
|
||||||
@ -147,14 +151,17 @@ class FixtureControllerTest extends TestCase
|
|||||||
|
|
||||||
public function testNothingToLoadParticularExceptOnes()
|
public function testNothingToLoadParticularExceptOnes()
|
||||||
{
|
{
|
||||||
$this->_fixtureController->actionLoad('First', '-First');
|
$this->_fixtureController->actionLoad(['First', '-First']);
|
||||||
|
|
||||||
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should not be loaded');
|
$this->assertEmpty(
|
||||||
|
FixtureStorage::$firstFixtureData,
|
||||||
|
'first fixture data should not be loaded'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testNothingToUnloadParticularExceptOnes()
|
public function testNothingToUnloadParticularExceptOnes()
|
||||||
{
|
{
|
||||||
$this->_fixtureController->actionUnload('First', '-First');
|
$this->_fixtureController->actionUnload(['First', '-First']);
|
||||||
|
|
||||||
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should not be loaded');
|
$this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should not be loaded');
|
||||||
}
|
}
|
||||||
@ -164,7 +171,7 @@ class FixtureControllerTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testNoFixturesWereFoundInLoad()
|
public function testNoFixturesWereFoundInLoad()
|
||||||
{
|
{
|
||||||
$this->_fixtureController->actionLoad('NotExistingFixture');
|
$this->_fixtureController->actionLoad(['NotExistingFixture']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -172,9 +179,8 @@ class FixtureControllerTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testNoFixturesWereFoundInUnload()
|
public function testNoFixturesWereFoundInUnload()
|
||||||
{
|
{
|
||||||
$this->_fixtureController->actionUnload('NotExistingFixture');
|
$this->_fixtureController->actionUnload(['NotExistingFixture']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class FixtureConsoledController extends FixtureController
|
class FixtureConsoledController extends FixtureController
|
||||||
@ -183,5 +189,4 @@ class FixtureConsoledController extends FixtureController
|
|||||||
public function stdout($string)
|
public function stdout($string)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user