make tests work on HHVM

Mocking the ApiException leads to a bad method call exception on HHVM.
Since mocking the exception has no real value, using an instance of
the exception itself is a sufficient fix. Now, tests run properly on
HHVM enabling it to verify full HHVM support.