Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when relationships are arrays. #5

Open
kevdowney opened this issue Aug 4, 2014 · 0 comments
Open

Error when relationships are arrays. #5

kevdowney opened this issue Aug 4, 2014 · 0 comments

Comments

@kevdowney
Copy link

Installed v1.0.0

 codesleeve/fixture                v1.0.0             A framework agnostic, simple (yet elegant) fixture library for php.
 codesleeve/fixture-l4             dev-master 23db25b A simple, easy to use fixture library for Laravel 4

ErrorException: explode() expects parameter 2 to be string, array given

/api/vendor/codesleeve/fixture/src/Codesleeve/Fixture/Drivers/Eloquent.php:147
/api/vendor/codesleeve/fixture/src/Codesleeve/Fixture/Drivers/Eloquent.php:113
/api/vendor/codesleeve/fixture/src/Codesleeve/Fixture/Drivers/Eloquent.php:71
/api/vendor/codesleeve/fixture/src/Codesleeve/Fixture/Fixture.php:312
/api/vendor/codesleeve/fixture/src/Codesleeve/Fixture/Fixture.php:289
/api/vendor/codesleeve/fixture/src/Codesleeve/Fixture/Fixture.php:252
/api/vendor/codesleeve/fixture/src/Codesleeve/Fixture/Fixture.php:203
/api/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:208

fixtures/assets.php

return array(
    'asset_1' => array(
        'account' => 'account_1',
        'url' => 'https://example.com/images/image1.jpg',
        'name' => 'image1.jpg',
        'type' => 'image',
    ),
    'asset_2' => array(
        'account' => 'account_1',
        'url' => 'https://example.com/images/image2.jpg',
        'name' => 'image2.jpg',
        'type' => 'image',
    ),
);

fixtures/products.php

return array(
    'product_2_service' => array(
        'type' => 'service',
        'name' => 'Test Service Product 2',
        'description' => 'Qui aliquid magni laborum et aliquam. Nesciunt ut reiciendis libero architecto aliquid atque maiores. Placeat cum incidunt omnis tempore qui.',
        'sku' => 'TEST_SKU-SERVICE-00002',
       ...
        'assets' => 'asset_1,asset_2'  // OK
       ...
        'assets' => array('asset_1', 'asset_2')  // ERROR
    ),
);

Your documentation says to use arrays for these many relationships, so either we should update the documentation or fix this to support array relationships?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant