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

Fix TypeError on true === needsCompleteGeneration() in ObjectGenerator #715

Merged
merged 5 commits into from
Apr 18, 2017
Merged

Fix TypeError on true === needsCompleteGeneration() in ObjectGenerator #715

merged 5 commits into from
Apr 18, 2017

Conversation

DZunke
Copy link
Contributor

@DZunke DZunke commented Apr 14, 2017

There was a TypeError in the SimpleObjectGenerator. If false === $context->needsCompleteGeneration() was false the Objects did not get returned but at the next line it needed the FixtureSet instead of the Objects, so the Line before to directly get the Objects into $fixtureSet was wrong.

Had not taken a deeper look but at the moment i created this fix my fixtures got generated. The two Tests that will fail with this pr were failing before. Sorry i had not extended the tests of SimpleObjectGenerator but while fixing a TypeError the existing Test was to crazy for me 😉

Origin Exception:

TypeError: Argument 2 passed to Nelmio\Alice\Generator\ObjectGenerator\SimpleObjectGenerator::completeObject() must be an instance of Nelmio\Alice\Generator\ResolvedFixtureSet, instance of Nelmio\Alice\ObjectBag given, called in /mnt/c/MyProject/vendor/nelmio/alice/src/Generator/ObjectGenerator/SimpleObjectGenerator.php on line 91

@theofidry
Copy link
Member

Hm interesting, the change seems right but I'm surprised this is not covered by the tests. Would it be possible to have a scenario showing that issue? This should be easily doable by using custom entities and a test case in LoaderIntegrationTest

@theofidry theofidry added this to the 3.0.0 milestone Apr 14, 2017
@DZunke
Copy link
Contributor Author

DZunke commented Apr 18, 2017

Hey @theofidry i had a look and created a testcase that triggered the error. Hopefully the test is what you were looking for 😄

@theofidry theofidry merged commit 9077a07 into nelmio:master Apr 18, 2017
theofidry added a commit that referenced this pull request Apr 18, 2017
theofidry added a commit to theofidry/alice that referenced this pull request Apr 18, 2017
theofidry added a commit that referenced this pull request Apr 18, 2017
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