Closed spamoom closed 10 years ago
Yeah, this should be fairly easy to implement. I'll try to find time to do it soon.
Interesting. That's useful for me too.
I've just encountered this need as well. It would be nice if overrides could cascaded through the fixtures attributes tree into child models.
This would also require that TestDummy does not add an override value to a model that does not have that column. IE: TestDumy\Builder -> mergeFixtureWithOverrides($type, $fields) should not blindly use array_merge. It should first check to see if the keys in $fields are also keys in the current fixture.
If ever get time I'll create a PR....
As I mentioned in the above pull request, https://github.com/laracasts/TestDummy/pull/29 The test only failed because composer.json was requiring "illuminate/support": "~5.0", which technically does not exist yet and so composer instal failed. With the requirement changed to 4.2 phpSpec is able to run and all 10 of its test do pass. Please consider this pull request as I believe that it is an important patch.
Okay, updated tests to bring back to green.
Thanks for this.
Thank you, I appreciate it!
On Sep 27, 2014, at 4:32 PM, Jeffrey Way notifications@github.com wrote:
Okay, updated tests to bring back to green.
Thanks for this.
— Reply to this email directly or view it on GitHub.
At the moment to set overrides on a relationship object I need to initiate both manually...
In the example above.. I'd like to see a method of overriding Brand attributes via a Trip create()
I could probably implement this, but wanted to see if anyone else would benefit first!