Skip to content

Add integration tests for ORM features #37

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

Merged
merged 4 commits into from
Nov 23, 2018

Conversation

lcobucci
Copy link
Contributor

@ondrejmirtes there's also a small fix which I can move to another PR if needed.

The methods `EntityManagerInterface#getReference()` and
`EntityManagerInterface#getPartialReference()` have nullable return.

That's properly documented for `getReference()` but had to be fixed for
`getPartialReference()`.
@lcobucci lcobucci force-pushed the add-integration-tests branch from 4aa9f95 to 2c64003 Compare August 18, 2018 20:14
}

return $type;
return TypeCombinator::addNull(new ObjectType($argType->getValue()));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix may be valid for ORM, but it's invalid for MongoDB ODM: getReference and getPartialReference don't return null in ODM. That said, it's best to further split this extension since both methods in question aren't part of the ObjectManager interface.

@lookyman
Copy link
Contributor

lookyman commented Nov 9, 2018

LGTM 😊

@ondrejmirtes
Copy link
Member

Hi, this is fine, going to merge this, but integration tests should also inspect some negative cases - actually verify that the extension doesn't just return mixed and thus turning off all checks, but that it actually returns the right thing. So there should be some negative checks generating error messages as well.

@ondrejmirtes ondrejmirtes merged commit 22f0898 into phpstan:master Nov 23, 2018
@lcobucci
Copy link
Contributor Author

@ondrejmirtes I think that we missid what @alcaeus said?

@lcobucci lcobucci deleted the add-integration-tests branch November 23, 2018 14:15
@alcaeus
Copy link

alcaeus commented Nov 23, 2018

Yep, not even as much as a reply to the highlighted issue. @ondrejmirtes the change to th extension is invalid, as is the original assumption that the ObjectManager interface provides a getReference method.

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.

4 participants