Skip to content

ProductFixture overwritten and using a different Factory #91

@seizan8

Description

@seizan8

/config/app/services/fixtures.xml

<service
        class="Brille24\SyliusCustomerOptionsPlugin\Fixture\ProductFixture"
        id="sylius.fixture.product"
>
    <argument type="service" id="doctrine.orm.default_entity_manager"/>
    <argument type="service" id="brille24.factory.product"/>
    <tag name="sylius_fixtures.fixture" />
</service>

This causes problems if another bundle would do the same. The ProductFixture would be overwritten twice.
For the Factory, I think it would be better if the sylius ProductExampleFactory was decorated. Is there a reason it is not?
The Fixture seems a bit trickier to me. I think it would be better to tell the user to overwrite the ProductFixture himself. Ideally there would be a static function or trait he could call for the configureResourceNode of brille24. So he would get later updates automatically. Or I guess, you could also decorate the ProductFixture? Never tried that, though I don't see why that wouldn't work.

Side note: the brille24 ProductFactory also has a useless configureOptions method, it never gets called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions