protected function mockEvent($type) { $methods = get_class_methods('EchoEvent'); $methods = array_diff($methods, array('userCan', 'getLinkMessage', 'getLinkDestination')); $event = $this->getMockBuilder('EchoEvent')->disableOriginalConstructor()->setMethods($methods)->getMock(); $event->expects($this->any())->method('getType')->will($this->returnValue($type)); $event->expects($this->any())->method('getCategory')->will($this->returnValue(EchoNotificationController::getNotificationCategory($type))); return $event; }
/** * Get the category of the event type * @return string */ public function getCategory() { return EchoNotificationController::getNotificationCategory($this->type); }