public function testRemove()
 {
     $handlers = new HandlerContainer();
     $this->assertFalse($handlers->has('code'));
     $handlers->add('code', function (ShortcodeInterface $s) {
     });
     $this->assertTrue($handlers->has('code'));
     $handlers->remove('code');
     $this->assertFalse($handlers->has('code'));
 }
Beispiel #2
0
 /**
  * Return true is the given name exist in shortcodes array.
  *
  * @param string $name
  *
  * @return bool
  */
 public function exists($name)
 {
     return $this->handlers->has($name);
 }