8000 [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite · symfony/symfony@0577c7b · GitHub
[go: up one dir, main page]

Skip to content

Commit 0577c7b

Browse files
[Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
1 parent da0b520 commit 0577c7b

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,12 @@ private function addTaggedListeners(ContainerBuilder $container)
109109
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))));
110110
}
111111

112-
if ($lazy = isset($tag['lazy']) && $tag['lazy']) {
112+
if ($lazy = !empty($tag['lazy'])) {
113113
$taggedListenerDef->setPublic(true);
114114
}
115115

116116
// we add one call per event per service so we have the correct order
117-
$this->getEventManagerDef($container, $con)->addMethodCall('addEventListener', array(
118-
$tag['event'],
119-
$lazy ? $id : new Reference($id),
120-
));
117+
$this->getEventManagerDef($container, $con)->addMethodCall('addEventListener', array(array($tag['event']), $lazy ? $id : new Reference($id)));
121118
}
122119
}
123120
}

src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public function testProcessEventListenersWithPriorities()
9090

9191
$this->assertEquals(
9292
array(
93-
array('addEventListener', array('foo_bar', new Reference('c'))),
94-
array('addEventListener', array('foo_bar', new Reference('a'))),
95-
array('addEventListener', array('bar', new Reference('a'))),
96-
array('addEventListener', array('foo', new Reference('b'))),
97-
array('addEventListener', array('foo', new Reference('a'))),
93+
array('addEventListener', array(array('foo_bar'), new Reference('c'))),
94+
array('addEventListener', array(array('foo_bar'), new Reference('a'))),
95+
array('addEventListener', array(array('bar'), new Reference('a'))),
96+
array('addEventListener', array(array('foo'), new Reference('b'))),
97+
array('addEventListener', array(array('foo'), new Reference('a'))),
9898
),
9999
$methodCalls
100100
);
@@ -138,16 +138,16 @@ public function testProcessEventListenersWithMultipleConnections()
138138

139139
$this->assertEquals(
140140
array(
141-
array('addEventListener', array('onFlush', new Reference('a'))),
142-
array('addEventListener', array('onFlush', new Reference('b'))),
141+
array('addEventListener', array(array('onFlush'), new Reference('a'))),
142+
array('addEventListener', array(array('onFlush'), new Reference('b'))),
143143
),
144144
$container->getDefinition('doctrine.dbal.default_connection.event_manager')->getMethodCalls()
145145
);
146146

147147
$this->assertEquals(
148148
array(
149-
array('addEventListener', array('onFlush', new Reference('a'))),
150-
array('addEventListener', array('onFlush', new Reference('c'))),
149+
array('addEventListener', array(array('onFlush'), new Reference('a'))),
150+
array('addEventListener', array(array('onFlush'), new Reference('c'))),
151151
),
152152
$container->getDefinition('doctrine.dbal.second_connection.event_manager')->getMethodCalls()
153153
);

0 commit comments

Comments
 (0)
0