[tests] Adapt for testing with HHVM.
[HHVM] Work around a bug in class_exists() with non-string values.