_getTestEntityManager(); $config = $em->getConfiguration(); $config->addCustomHydrationMode('CustomHydrator', CustomHydrator::class); $hydrator = $em->newHydrator('CustomHydrator'); $this->assertInstanceOf(CustomHydrator::class, $hydrator); $this->assertNull($config->getCustomHydrationMode('does not exist')); } } class CustomHydrator extends AbstractHydrator { protected function hydrateAllData() { return $this->_stmt->fetchAll(PDO::FETCH_ASSOC); } }