コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: Event.php プロジェクト: biribogos/wikihow-src
 /**
  * Get the category of the event type
  * @return string
  */
 public function getCategory()
 {
     return EchoNotificationController::getNotificationCategory($this->type);
 }