vierge-noire / cakephp-fixture-factories

CakePHP Fixture Factories
https://vierge-noire.github.io/
MIT License
85 stars 20 forks source link

Feature requests: Enhancements to configuration #178

Closed jamisonbryant closed 2 years ago

jamisonbryant commented 2 years ago

Hi there,

It would be helpful if we had an additional configuration option to specify where the baked factory files should go, and if the config structure was a bit more consistent with Cake standards (that is, grouped), e.g.:

// filename: app.php
[
...
    // old format, no grouping
    'TestFixtureNamespace' => 'App\Test\Fixture\Factory',

    // new format, grouping
    'FixtureFactories' => [
        'testFixtureNamespace' => 'App\Test\Fixture\Factory',
        // new setting
        'bakeOutputDir' => TESTS . 'Fixture' . DS . 'Factory',
    ],
...
]

Would something like this be possible to add? Currently cake bake fixture_factory puts the generated file in the standard directory regardless of what the TestFixtureNamespace is configured to be. It is often helpful to have the output directory match the namespace at the top of the file.

Happy to take a crack at this, just let me know!

pabloelcolombiano commented 2 years ago

Go for it!

jamisonbryant commented 2 years ago

@pabloelcolombiano PRs up for both tickets I opened, thanks very much!

jamisonbryant commented 2 years ago

@pabloelcolombiano Any feedback on the attached PR?

pabloelcolombiano commented 2 years ago

@jamisonbryant thanks for the contribution indeed. I do not mind the non-BC aspect of it. This should however be documented in the docs. You will find my comments in the PR. I do not mind also a PR to fix psalm, if you can/will, prior to this. If you do not have capacities, I will try to get this done during the coming days.

jamisonbryant commented 2 years ago

Noted, thanks for the feedback. Regretfully I will not be able to address it for a week or two, as I am traveling out of the country with no access to my code.

If you are able to address the Psalm issue by the time I get back, I will make the changes requested and we should be able to get it merged in no time.

pabloelcolombiano commented 2 years ago

Thanks a lot for this contribution. I will run a few additional tests and create a new tag.