Coder Social home page Coder Social logo

Comments (5)

alexislefebvre avatar alexislefebvre commented on September 22, 2024 1

Please try the last release: https://github.com/liip/LiipTestFixturesBundle/releases/tag/2.4.0

from liiptestfixturesbundle.

alexislefebvre avatar alexislefebvre commented on September 22, 2024

We may had a compatibility layer in order to call getCache() if it's available, or getCacheDriver() otherwise.

from liiptestfixturesbundle.

magnetik avatar magnetik commented on September 22, 2024

The new getCache() method in AbstractClassMetadataFactory in now protected (and was public)

from liiptestfixturesbundle.

mbabker avatar mbabker commented on September 22, 2024

This one's fun.

Based on liip/LiipFunctionalTestBundle#69 the intent is to flush the result cache before loading fixtures, but it's pulling the cache driver from the object manager's metadata factory. Only the ORM has a result cache though. Making things even more inconsistent, the ORM entity manager configures the metadata factory with the metadata cache service, which might not even be the same service as the result cache service. The document managers for MongoDB and PHPCR are also injecting the metadata cache service.

So if the intent is to clear the result cache, as the original PR implies, then there is a long-standing bug that needs to be fixed in the ORMDatabaseTool and it needs to pull the correct cache service from the entity manager's configuration instance and the MongoDBDatabaseTool and PHPCRDatabaseTool classes can have this cache clearing operation removed.

If the intent is to clear the metadata cache, then the way forward looks to be replacing the getMetadataFactory() calls with getConfiguration() (note, that method isn't part of the ObjectManager interface) and fetching the metadata cache service from there.

from liiptestfixturesbundle.

MarkPedron avatar MarkPedron commented on September 22, 2024

If the intent is to clear the metadata cache, then the way forward looks to be replacing the getMetadataFactory() calls with getConfiguration() (note, that method isn't part of the ObjectManager interface) and fetching the metadata cache service from there.

I prepared a MR which implements this suggestion - the property $om is annotated as an EntityManager in ORMDatabaseTool, so the fact that getConnection is not part of the ObjectManager interface does not seem to be an issue here.

I do not have much experience with the doctrine caching system, but this PR makes the tests in my projects run.

Edit

This only fixes the issue for ORMDatabaseTool, not MongoDB/PHPCR/ORMSqlite

from liiptestfixturesbundle.

Related Issues (20)

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.