Fix infinite loop in `isTestClass`

This fixes a case where an infinite loop can be encountered with HHVM when parsing code like this: https://github.com/zendframework/zf2/blob/fc64ed00440fe1948b8cb41d3b08c5f2b08c45bb/library/Zend/Mime/Exception/RuntimeException.php#L35