/**
* WordPress testing function used to avoid return expectations on action hooks.
* Throws exception for WordPress filters and generic PHP function testing.
*
* @param callable $callback
* @return \Mockery\Expectation
*/
public function whenHappen(callable $callback)
{
if (!$this->isAddedHook && !$this->isAction) {
throw new RuntimeException('whenHappen() can only be used for WordPress actions or added filters expectations.');
}
return $this->expectation->andReturnUsing($callback);
}