'Drupal\\Core\\TypedData' =>
$this->root . '/core/lib/Drupal/Core/TypedData',
'Drupal\\Core\\Validation' =>
$this->root . '/core/lib/Drupal/Core/Validation',
]);
$module_handler =
$this->
getMockBuilder('Drupal\Core\Extension\ModuleHandlerInterface'
) ->
disableOriginalConstructor() ->
getMock();
$class_resolver =
$this->
getMockBuilder('Drupal\Core\DependencyInjection\ClassResolverInterface'
) ->
disableOriginalConstructor() ->
getMock();
$this->typedDataManager =
new TypedDataManager($namespaces,
$cache_backend,
$module_handler,
$class_resolver);
$this->typedDataManager->
setValidationConstraintManager( new ConstraintManager($namespaces,
$cache_backend,
$module_handler) );
// Typed data definitions access the manager in the container.
$container =
new ContainerBuilder();
$container->
set('typed_data_manager',
$this->typedDataManager
);
\Drupal::
setContainer($container);
$translator =
$this->
createMock('Drupal\Core\Validation\TranslatorInterface'
);
$translator->
expects($this->
any()) ->
method('trans'
) ->
willReturnCallback(function D
$id) {