Example #1
0
 public function testOnceWorkFine()
 {
     $that = $this;
     Event::once('test_once_evt', function ($args) use($that) {
         $that->onceTestCb();
     });
     Event::fire('test_once_evt');
     Event::fire('test_once_evt');
     $this->assertEquals(1, count($this->dataMap), 'fire twice event work fail');
     $this->assertTrue(in_array('once', $this->dataMap), 'fire twice event work fail');
 }