Skip to content

Support for custom store class - #2

Merged
DavertMik merged 2 commits into
Codeception:masterfrom
marden:custom-store
Mar 16, 2021
Merged

Support for custom store class#2
DavertMik merged 2 commits into
Codeception:masterfrom
marden:custom-store

Conversation

@marden

Copy link
Copy Markdown
Contributor

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

@DavertMik

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

@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
Copy Markdown
ContributorAuthor

@DavertMik Please review.

@marden

Copy link
Copy Markdown
ContributorAuthor

@DavertMik Hello?

@DavertMik

Copy link
Copy Markdown
Member

Thanks! Looks good to me!
Merging

@DavertMik
DavertMik merged commit cf66d54 into Codeception:masterMar 16, 2021
Sign up for freeto 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

@marden@DavertMik