yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.24k stars 6.91k forks source link

applying all fixture produces an error #4780

Closed mitalcoi closed 10 years ago

mitalcoi commented 10 years ago

After last update i can't load my fixtures:

vagrant@locksmith:/var/www$ php yii fixture/load *  
Some fixtures were not found under path:
    /var/www/tests/unit/fixtures

Check that they have correct namespace "tests\unit\fixtures" 
    1. assets
    2. codeception.yml
    3. commands
    4. components
    5. composer.json
    6. composer.json~
    7. composer.lock
    8. config
    9. consumers
    10. controllers
    11. environments
    12. init
    13. LICENSE.md
    14. mail
    15. migrations
    16. models
    17. node
    18. rbac
    19. README.md
    20. reports
    21. requirements.php
    22. runtime
    23. tests
    24. traits
    25. vagrant
    26. Vagrantfile
    27. vendor
    28. views
    29. web
    30. widgets
    31. yii
    32. yii.bat

Error: No files were found by name: "assets, codeception.yml, commands, components, composer.json, composer.json~, composer.lock, config, consumers, controllers, environments, init, LICENSE.md, mail, migrations, models, node, rbac, README.md, reports, requirements.php, runtime, tests, traits, vagrant, Vagrantfile, vendor, views, web, widgets, yii, yii.bat".
Check that files with these name exists, under fixtures path: 
"/var/www/tests/unit/fixtures".

Before update all works well

Ragazzo commented 10 years ago

are you sure your fixtures is under the default path of tests\unit\fixtures ? Path is calculated in this way

mitalcoi commented 10 years ago

of course. earlier it works without any problem 2014-08-21 18 48 15

Ragazzo commented 10 years ago

not sure about this one, could you make some simple debug maybe with var_dump + exit on FixtureController?

mitalcoi commented 10 years ago

what variable i need to debug exactly?

Ragazzo commented 10 years ago
mitalcoi commented 10 years ago
vagrant@locksmith:/var/www$ php yii fixture/load *
$namespace: tests\unit\fixtures
$fixturesInput: Array
(
    [0] => assets
    [1] => codeception.yml
    [2] => commands
    [3] => components
    [4] => composer.json
    [5] => composer.json~
    [6] => composer.lock
    [7] => config
    [8] => consumers
    [9] => controllers
    [10] => environments
    [11] => init
    [12] => LICENSE.md
    [13] => mail
    [14] => migrations
    [15] => models
    [16] => node
    [17] => rbac
    [18] => README.md
    [19] => reports
    [20] => requirements.php
    [21] => runtime
    [22] => tests
    [23] => traits
    [24] => vagrant
    [25] => Vagrantfile
    [26] => vendor
    [27] => views
    [28] => web
    [29] => widgets
    [30] => yii
    [31] => yii.bat
)
$foundFixtures: Array
(
)
Ragazzo commented 10 years ago

i think it is a vagrant or OS problem of usage * as in input argument, i remember similar issue or question discussed with @qiangxue what is your thoughts ?

@mitalcoi can you also try without * by specifying fixtures names directly in different combinations ?

mitalcoi commented 10 years ago

it is not a vargant problem. on my remote server i've got identical error.

Ragazzo commented 10 years ago

yes, it works fine for me on Ubuntu 13.04 but as you can see it is a console problem since it thinkgs * as simple directory list, early it was all instead of *

mitalcoi commented 10 years ago

If i specifuing fixture directly, all works

vagrant@locksmith:/var/www$ php yii fixture/load User
Fixtures namespace is: 
    tests\unit\fixtures

Global fixtures will be used:

    1. yii\test\InitDb

Fixtures below will be loaded:

    1. User
Ragazzo commented 10 years ago

yes , it is * problem

mitalcoi commented 10 years ago

maybe we need revert to using "all" as constant name?

Ragazzo commented 10 years ago

@qiangxue look at this one when you will have time

qiangxue commented 10 years ago

Can you try php yii fixture/load "*"?

mitalcoi commented 10 years ago

yes, it is!

samdark commented 10 years ago

Closing since it's a shell issue and not Yii's one.

Ragazzo commented 10 years ago

@samdark yes, but i think maybe changing to all is better? Or we need a not at least about this situations

samdark commented 10 years ago

We just need to add quotes to examples.

Ragazzo commented 10 years ago

need also to mention this unexpected behavior

Ragazzo commented 10 years ago

@samdark should i submit PR or you will handle this one ?

samdark commented 10 years ago

PRs are always helpful.