Elgg\Notifications\NotificationsService::unregisterMethod PHP Method

unregisterMethod() public method

See also: elgg_unregister_notification_method()
public unregisterMethod ( $name )
    public function unregisterMethod($name)
    {
        if (isset($this->methods[$name])) {
            unset($this->methods[$name]);
            return true;
        }
        return false;
    }

Usage Example

 public function testUnregisterMethod()
 {
     $this->setupServices();
     $this->notifications->registerMethod('test_method');
     $this->assertTrue($this->notifications->unregisterMethod('test_method'));
     $this->assertEquals(array(), $this->notifications->getMethods());
     $this->assertFalse($this->notifications->unregisterMethod('test_method'));
 }