/** * Test the removeEvent method. * * @return void * * @covers Joomla\Event\Dispatcher::removeEvent * @since 1.0 */ public function testRemoveEvent() { // No exception. $this->instance->removeEvent('non-existing'); $event = new Event('onTest'); $this->instance->addEvent($event); // Remove by passing the instance. $this->instance->removeEvent($event); $this->assertFalse($this->instance->hasEvent('onTest')); $this->instance->addEvent($event); // Remove by name. $this->instance->removeEvent('onTest'); $this->assertFalse($this->instance->hasEvent('onTest')); }