cork() public method

Prevent events from firing until uncork() is called
public cork ( )
Beispiel #1
0
 public function testEventCorking()
 {
     $fired = array();
     $events = new Events();
     $events->register('*', function () use(&$fired) {
         $fired[] = func_get_args();
     });
     $events->cork();
     $events->trigger('beholdLlamas', new \stdClass());
     $this->assertCount(0, $fired);
     $events->uncork();
     $this->assertCount(1, $fired);
 }