$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) { return $id;
});
$this->contextFactory =
new ExecutionContextFactory($translator);
$this->validatorFactory =
new ConstraintValidatorFactory();
$this->recursiveValidator =
new RecursiveValidator($this->contextFactory,
$this->validatorFactory,
$this->typedDataManager
);
} /**
* Ensures that passing an explicit group is not supported.
*
* @covers ::validate
*/
public function testValidateWithGroups() { $this->
expectException(\LogicException::
class);
$this->recursiveValidator->
validate('test', NULL, 'test group'
);
}