Beispiel #1
0
 public function testEventPublish()
 {
     $eventBus = new EventBus();
     $listener = new PhotoTestEventListener();
     $eventBus->subscribe($listener);
     $uuid = Uuid::uuid5(Uuid::NAMESPACE_DNS, 'photo1');
     new Photo("/some/file/path.img", $uuid->toString(), $eventBus);
     $this->assertTrue($listener->handled());
 }
Beispiel #2
0
 public function testEventPublish()
 {
     $eventBus = new EventBus();
     $event = new TestEvent();
     $listener = new EventBusTestEventListener();
     $eventBus->subscribe($listener);
     $eventBus->publish($event);
     $this->assertTrue($listener->handled());
 }