Git Product home page Git Product logo

Comments (6)

TomHAnderson avatar TomHAnderson commented on June 10, 2024

Why isn't $metadata->getReflectionClass()? Can we solve that to get the same value as a new \ReflectionClass?

from doctrine-laminas-hydrator.

rodsouto avatar rodsouto commented on June 10, 2024

Ok, I think the code works ok without line #L485 and the problem is just testHydrateOneToManyAssociationByReferenceUsingIdentifiersArrayForRelations missing a expectation to return the correct mock for $this->objectManager->getClassMetadata(get_class($object)) in https://github.com/doctrine/doctrine-laminas-hydrator/blob/master/src/DoctrineObject.php#L136

from doctrine-laminas-hydrator.

TomHAnderson avatar TomHAnderson commented on June 10, 2024

Can you put that into a PR?

from doctrine-laminas-hydrator.

rodsouto avatar rodsouto commented on June 10, 2024

Yes, I'm trying to figure out how to fix it without changing too much tests

The problem with testHydrateOneToManyAssociationByReferenceUsingIdentifiersArrayForRelations is that if you keep the PK, it calls an aditional hydrate() in https://github.com/doctrine/doctrine-laminas-hydrator/blob/master/src/DoctrineObject.php#L496 (that's why it's failing only in ByReferenceUsingIdentifiersArray)

In this specific test case (by reference + array identifier) we need to mock two metadata in configureObjectManagerForOneToManyEntity (currently it's only mocking $this->metadata for OneToManyEntity but we also need a mock for ByValueDifferentiatorEntity), but I think that requires to do quite a big refactor in the test case :/

from doctrine-laminas-hydrator.

TomHAnderson avatar TomHAnderson commented on June 10, 2024

@rodsouto this repo has migrated to Doctrine 3.0. Are you still going to submit a PR?

from doctrine-laminas-hydrator.

rodsouto avatar rodsouto commented on June 10, 2024

Not in the short term, you can close this if you like

from doctrine-laminas-hydrator.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.