Skip to content

Conversation

marden
Copy link
Contributor

@marden marden commented Dec 23, 2020

At the moment there is no way to specify custom store for Factory Muffin.

This PR adds support for storeClass config variable to specify a class to be used as a store.

Module config example:

modules:
  config:
    DataFactory:
      factories: tests/_support/factories
      storeClass: \common\tests\store\MyCustomStore

@Naktibalda Naktibalda requested a review from DavertMik December 23, 2020 12:54
@DavertMik
Copy link
Member

Thanks @marden !

  1. What if the store requires some arguments on creation? This config doesn't cover this case. Could you mention explicitly in the documentation that the class will be created via constructor with no extra params. Or maybe instead of a class name ask for a factory method so it could create any kind of store.
  2. Could you provide usage example in documentation? Documentation is inside the same file in docblocks.

@marden
Copy link
Contributor Author

marden commented Dec 23, 2020

@DavertMik Thanks for the feedback.

  • Renamed parameter to customStore
  • It can be a simple class or a factory with create method
  • Updated doc.

@marden
Copy link
Contributor Author

marden commented Jan 11, 2021

@DavertMik Please review.

@marden
Copy link
Contributor Author

marden commented Mar 11, 2021

@DavertMik Hello?

@DavertMik
Copy link
Member

Thanks! Looks good to me!
Merging

@DavertMik DavertMik merged commit cf66d54 into Codeception:master Mar 16, 2021
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

Successfully merging this pull request may close these issues.

2 participants