Skip to content

Add integration tests for ODM features #39

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

Closed

Conversation

lcobucci
Copy link
Contributor

@lcobucci lcobucci commented Aug 18, 2018

Which kicks-off the support for #26

Depends on #38

@lcobucci lcobucci force-pushed the add-integration-tests-for-odm-features branch 3 times, most recently from 4facb3f to 02e81e7 Compare August 18, 2018 17:46
The methods `EntityManagerInterface#getReference()` and
`EntityManagerInterface#getPartialReference()` have nullable return.

That's properly documented for `getReference()` but had to be fixed for
`getPartialReference()`.
So that things would be compatible with both ORM and ODM.
With the necessary dependencies on Travis-CI to ensure the build will
run properly.

Following the same approach as
https://github.com/doctrine/mongodb/blob/1.6.3/.travis.yml#L61 (for PHP
7+ installation).
@lcobucci lcobucci force-pushed the add-integration-tests-for-odm-features branch from 02e81e7 to af7bb42 Compare August 18, 2018 20:16
Copy link

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

This PR is incomplete: there needs to be more distinction as to the types returned. For example, the repository extension always returns an EntityRepository type, even for ODM which isn't correct. See #36 for a more complete implementation. I would suggest combining the tests from this PR with the changes from #36. BC preserving changes (e.g. not removing the Entity* classes can be dropped from the other PR. Opinion @ondrejmirtes?

@ondrejmirtes
Copy link
Member

Hi, I'm not able to try this out because of:

  Problem 1
    - alcaeus/mongo-php-adapter 1.1.x-dev requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.5 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.4 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.3 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.2 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.1 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - alcaeus/mongo-php-adapter 1.1.0 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - Installation request for alcaeus/mongo-php-adapter ^1.1 -> satisfiable by alcaeus/mongo-php-adapter[1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.x-dev].

I think it shouldn't be necessary to have installed mongodb extension in order to develop this package. What is it exactly required for?

@alcaeus
Copy link

alcaeus commented Nov 23, 2018

Because of the tests: they need to import ODM classes. You could remove the dependency, skip the tests if ODM isn’t installed and only install it on travis. However, as changing something might break ODM functionality, I would recommend to keep this as is. This extension is supposed to cover ORM and ODM, so it’s expected to have both as a dev dependency.

@ondrejmirtes
Copy link
Member

Is it just because of some use or ::class or is actually some code from alcaeus/mongo-php-adapter executed?

@mcfedr
Copy link
Contributor

mcfedr commented Feb 12, 2019

All the tests run fine if I remove alcaeus/mongo-php-adapter from composer.json, and without mongodb installed

@alcaeus
Copy link

alcaeus commented Feb 12, 2019

All the tests run fine if I remove alcaeus/mongo-php-adapter from composer.json, and without mongodb installed

Correct, because you're pretending that the mongo extension is installed. You can skip the adapter package until you actually start using the ODM classes, at which point they'll fail if they can't find the classes you pretend are there.

@ondrejmirtes
Copy link
Member

Superceded by #48.

@lcobucci lcobucci deleted the add-integration-tests-for-odm-features branch February 12, 2019 16:34
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