예제 #1
0
 public function testRemoveUnknownListener()
 {
     $result = false;
     $callback = function () use(&$result) {
         $result = true;
     };
     Hooks::on('foo', $callback);
     Hooks::trigger('foo');
     $this->assertTrue($result);
     $result = false;
     $this->assertFalse(Hooks::removeListener('bar', $callback));
     Hooks::trigger('foo');
     $this->assertTrue($result);
 }