protected function _mockDispatchEvent(Event $event = null) { if (is_null($event)) { $event = new Event('cool-name-here'); } $this->Trait->expects($this->any())->method('dispatchEvent')->will($this->returnValue($event)); }