static function spy_class($class)
{
$spyClass = self::build_test_double(true, $class);
// If we've been given a type registrar, call it (we need to do this even if class exists, since PHPUnit resets globals, possibly de-registering between tests)
$type_registrar = self::$type_registrar;
if ($type_registrar) {
$type_registrar::register_double($spyClass, $class, self::$_is_interface[$class]);
}
return $spyClass;
}