How do you raise/fake an event so that you can test handlers listening for it? We use event integration (native and custom) in a lot of the plugins we build and I was wondering if anyone has come up with a simple way to raise those events at will, without having to follow a specific flow of execution.

For example, if you are listening for entries.saveEntry and don't want to manually save an entry in order for that event to be raised/triggered.

I think it would be nice to have a simple way of doing this and interested in seeing if anyone has found the need for such thing.

With enough patience, one could fake many events and call the service that raises them but I'm sure that there other developer way more clever than me that may have solved this already.
I believe events can be raised programmatically by calling them from services. You could mimic this behavior by creating an Event object ($event) and calling calling craft()-&gt;entries-&gt;onBeforeSaveEntry($event) yourself, for example. You would need to set up the event context and create a new Event object as the code does in the Entries Service below.

$event = new Event($this, array(
  'entry'      =&gt; $entry,
  'isNewEntry' =&gt; $isNewEntry
));

$this-&gt;onBeforeSaveEntry($event);


Check out the Entries Service around lines 165 to see how Craft uses events in that context. 

For each event call, the code is calling $this-&gt;raiseEvent('eventName', $event);

I bet with some minimal setup, you could write a test controller that can call these events at will. Good question - I've been going down the manual path for all my testing too!