コード例 #1
0
 /**
  * @test
  * @dataProvider data_getSubscribedSystems
  */
 public function test_getSubscribedSystems($event, $hasListeners, array $doc, array $lc, $expected)
 {
     $md = new ClassMetadata('Test');
     $md->documentListeners = $doc;
     $md->lifecycleCallbacks = $lc;
     /** @var EventManager|ObjectProphecy $em */
     $em = $this->prophesize(EventManager::class);
     $em->hasListeners(Arg::any())->willReturn($hasListeners);
     $lr = $this->prophesize(ListenerResolverInterface::class);
     $li = new ListenersInvoker($em->reveal(), $lr->reveal());
     $actual = $li->getSubscribedSystems($md, $event);
     $this->assertEquals($expected, $actual);
     $actual = $li->getSubscribedSystems2($md, $event);
     $this->assertEquals($expected, $actual);
 }
コード例 #2
0
 /**
  * @iterations 10000
  */
 public function getSubscribedSystems2_short()
 {
     $this->li->getSubscribedSystems2($this->md, Events::prePersist);
 }