Ejemplo n.º 1
0
 public function test_status()
 {
     $event = new GenericEvent();
     $this->assertTrue($event->isActive());
     $this->assertFalse($event->isHandled());
     $event->handle();
     $this->assertFalse($event->isActive());
     $this->assertTrue($event->isHandled());
 }
Ejemplo n.º 2
0
 public function test_dispatch_returns_handled_event_event()
 {
     $eventer = new Eventer();
     $event = new GenericEvent('foo');
     $eventer->subscribe($event->getName(), function (IEvent $event) {
         $event->handle();
     });
     $this->assertTrue($eventer->dispatch($event) === $event);
 }