|
@@ 87-99 (lines=13) @@
|
| 84 |
|
/** |
| 85 |
|
* @expectedException RuntimeException |
| 86 |
|
*/ |
| 87 |
|
public function testEventListenerMustBePublic() |
| 88 |
|
{ |
| 89 |
|
$container = $this->getContainer(); |
| 90 |
|
|
| 91 |
|
$def = new Definition('Foo'); |
| 92 |
|
$def->setPublic(false); |
| 93 |
|
$def->addTag('jms_serializer.event_listener'); |
| 94 |
|
|
| 95 |
|
$container->setDefinition('my_listener', $def); |
| 96 |
|
|
| 97 |
|
$pass = new RegisterEventListenersAndSubscribersPass(); |
| 98 |
|
$pass->process($container); |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
public function testEventListener() |
| 102 |
|
{ |
|
@@ 217-228 (lines=12) @@
|
| 214 |
|
/** |
| 215 |
|
* @expectedException RuntimeException |
| 216 |
|
*/ |
| 217 |
|
public function testEventSubscriberInterface() |
| 218 |
|
{ |
| 219 |
|
$container = $this->getContainer(); |
| 220 |
|
|
| 221 |
|
$def = new Definition('JMS\SerializerBundle\Tests\DependencyInjection\Fixture\VersionedObject'); |
| 222 |
|
$def->addTag('jms_serializer.event_subscriber'); |
| 223 |
|
|
| 224 |
|
$container->setDefinition('my_listener', $def); |
| 225 |
|
|
| 226 |
|
$pass = new RegisterEventListenersAndSubscribersPass(); |
| 227 |
|
$pass->process($container); |
| 228 |
|
} |
| 229 |
|
|
| 230 |
|
/** |
| 231 |
|
* @expectedException RuntimeException |
|
@@ 233-245 (lines=13) @@
|
| 230 |
|
/** |
| 231 |
|
* @expectedException RuntimeException |
| 232 |
|
*/ |
| 233 |
|
public function testEventSubscriberMustBePublic() |
| 234 |
|
{ |
| 235 |
|
$container = $this->getContainer(); |
| 236 |
|
|
| 237 |
|
$def = new Definition('JMS\SerializerBundle\Tests\DependencyInjection\Fixture\VersionedObject'); |
| 238 |
|
$def->setPublic(false); |
| 239 |
|
$def->addTag('jms_serializer.event_subscriber'); |
| 240 |
|
|
| 241 |
|
$container->setDefinition('my_listener', $def); |
| 242 |
|
|
| 243 |
|
$pass = new RegisterEventListenersAndSubscribersPass(); |
| 244 |
|
$pass->process($container); |
| 245 |
|
} |
| 246 |
|
} |
| 247 |
|
|
| 248 |
|
|