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

Add Array Source trait #87

Merged
merged 13 commits into from
Jun 7, 2022
Merged

Add Array Source trait #87

merged 13 commits into from
Jun 7, 2022

Conversation

bennothommo
Copy link
Member

Remake of #73.

This PR introduces the ability to create an "array source" model which provides arbitrary records via an array. These models will act, for all intents and purposes, as Eloquent models, but do not require a database.

The implementation of this feature is inspired by the Sushi library by Caleb Porzio but modified to work in Winter's architecture.

This PR also introduces a change to the testing suite, to cater for the facades used in this trait, and now creates a dummy application when running tests, which resolves a long-standing issue where facades in the test cases did not work.

The original constructor required a Container container, which while correct, cannot be resolved in tests. By default, Maker is brought in with the Winter application, and there's no real mechanism to override this, so changing this signature should be fine.
This should allow facades and other expected functionality to work, basically making the tests work with a real Laravel app.
If we ever get around to namespacing our test cases, this will help.
@bennothommo bennothommo added this to the v1.2.0 milestone Jun 7, 2022
@bennothommo bennothommo merged commit 221dcb2 into wip/1.2 Jun 7, 2022
@bennothommo bennothommo deleted the wip/1.2-array-source branch June 7, 2022 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant