Closed Kytrix closed 4 months ago
Out of curiosity: why would you need to detect if the bundle is managing a connection? :thinking:
Because I already have the issue of the tests were running without transaction (the bundle was somehow been disabled) and I don't want this could append again.
You could try
/** @var \PDO $connection */
$connection = $this->em->getConnection()->getNativeConnection();
if(!$connection->inTransaction()) {
$this->fail("No active transaction ! you could lost data !\n");
}
Thank you very much ! it works !
Hello, I previously used a test inside my ancestor test class constructor: if(!$this->em->getConnection()->isTransactionActive()) $this->fail("No active transaction ! you could lost data !\n");
But it seems to not work with lasts versions.
I made another test by looking in Connection params.
I try to get the driver class, but because the wrapperDriver is private I'm not able to test it's class, despite my debugger is able to see it :
Is there a better solution ?