// Use the protected property on the cache_clearer first to check whether
// the constraint manager is added there.
// Ensure that the proxy class is initialized, which has the necessary
// method calls attached.
\Drupal::
service('plugin.cache_clearer'
);
$plugin_cache_clearer = \Drupal::
service('drupal.proxy_original_service.plugin.cache_clearer'
);
$get_cached_discoveries =
function D
) { return $this->cachedDiscoveries;
};
$get_cached_discoveries =
$get_cached_discoveries->
bindTo($plugin_cache_clearer,
$plugin_cache_clearer);
$cached_discoveries =
$get_cached_discoveries();
$cached_discovery_classes =
[];
foreach ($cached_discoveries as $cached_discovery) { $cached_discovery_classes[] =
get_class($cached_discovery);
} $this->
assertContains('Drupal\Core\Validation\ConstraintManager',
$cached_discovery_classes);
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) { $this->
checkValidation($entity_type);
} }