With DoctrineCacheBundle being deprecated,
configuring caches through it has been deprecated. If you are using anything
other than the pool
or id
cache types, please update your configuration to
either use symfony/cache through the pool
type or configure your cache
services manually and use the service
type.
Symfony\Bridge\Doctrine\RegistryInterface
and Doctrine\Bundle\DoctrineBundle\Registry
service alias, use Doctrine\Common\Persistence\ManagerRegistry
instead.Doctrine\Common\Persistence\ObjectManager
service alias, use Doctrine\ORM\EntityManagerInterface
instead.If all of these are true:
Symfony\Bundle\FrameworkBundle\Client::disableReboot()
in your test caseSymfony\Bundle\FrameworkBundle\Client::request()
etc.) within your test caseDoctrine\Persistence\ObjectManager::refresh
)Your test case will fail since DoctrineBundle
1.12.3, as identity map is now cleared between each request
to better simulate real requests and avoid memory leaks. You have two options to solve this:
ObjectManager::refresh($entity)
with $entity = ObjectManager::find($entity->getId())
. This is the recommended solution.Write a compiler pass which restores old behaviour, e.g. by adding the following to your Kernel
class:
protected function build(\Symfony\Component\DependencyInjection\ContainerBuilder $container)
{
parent::build($container);
if ($this->environment === 'test') {
$container->addCompilerPass(new class implements \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface {
public function process(\Symfony\Component\DependencyInjection\ContainerBuilder $container)
{
$container->getDefinition('doctrine')->clearTag('kernel.reset');
}
}, \Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, 1);
}
}