[Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
This commit is contained in:
parent
da0b520a50
commit
0577c7b089
@ -109,15 +109,12 @@ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface
|
|||||||
throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s', $con, $id, implode(', ', array_keys($this->connections))));
|
throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s', $con, $id, implode(', ', array_keys($this->connections))));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($lazy = isset($tag['lazy']) && $tag['lazy']) {
|
if ($lazy = !empty($tag['lazy'])) {
|
||||||
$taggedListenerDef->setPublic(true);
|
$taggedListenerDef->setPublic(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// we add one call per event per service so we have the correct order
|
// we add one call per event per service so we have the correct order
|
||||||
$this->getEventManagerDef($container, $con)->addMethodCall('addEventListener', array(
|
$this->getEventManagerDef($container, $con)->addMethodCall('addEventListener', array(array($tag['event']), $lazy ? $id : new Reference($id)));
|
||||||
$tag['event'],
|
|
||||||
$lazy ? $id : new Reference($id),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,11 +90,11 @@ class RegisterEventListenersAndSubscribersPassTest extends TestCase
|
|||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
array(
|
array(
|
||||||
array('addEventListener', array('foo_bar', new Reference('c'))),
|
array('addEventListener', array(array('foo_bar'), new Reference('c'))),
|
||||||
array('addEventListener', array('foo_bar', new Reference('a'))),
|
array('addEventListener', array(array('foo_bar'), new Reference('a'))),
|
||||||
array('addEventListener', array('bar', new Reference('a'))),
|
array('addEventListener', array(array('bar'), new Reference('a'))),
|
||||||
array('addEventListener', array('foo', new Reference('b'))),
|
array('addEventListener', array(array('foo'), new Reference('b'))),
|
||||||
array('addEventListener', array('foo', new Reference('a'))),
|
array('addEventListener', array(array('foo'), new Reference('a'))),
|
||||||
),
|
),
|
||||||
$methodCalls
|
$methodCalls
|
||||||
);
|
);
|
||||||
@ -138,16 +138,16 @@ class RegisterEventListenersAndSubscribersPassTest extends TestCase
|
|||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
array(
|
array(
|
||||||
array('addEventListener', array('onFlush', new Reference('a'))),
|
array('addEventListener', array(array('onFlush'), new Reference('a'))),
|
||||||
array('addEventListener', array('onFlush', new Reference('b'))),
|
array('addEventListener', array(array('onFlush'), new Reference('b'))),
|
||||||
),
|
),
|
||||||
$container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls()
|
$container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls()
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
array(
|
array(
|
||||||
array('addEventListener', array('onFlush', new Reference('a'))),
|
array('addEventListener', array(array('onFlush'), new Reference('a'))),
|
||||||
array('addEventListener', array('onFlush', new Reference('c'))),
|
array('addEventListener', array(array('onFlush'), new Reference('c'))),
|
||||||
),
|
),
|
||||||
$container->getDefinition('doctrine.dbal.second_connection.event_manager')->getMethodCalls()
|
$container->getDefinition('doctrine.dbal.second_connection.event_manager')->getMethodCalls()
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user