ComponentValidator example


final class ComponentValidatorTest extends TestCase {

  /** * Tests that valid component definitions don't cause errors. * * @dataProvider dataProviderValidateDefinitionValid * * @throws \Drupal\sdc\Exception\InvalidComponentException */
  public function testValidateDefinitionValid(array $definition): void {
    $component_validator = new ComponentValidator();
    $component_validator->setValidator();
    $this->assertTrue(
      $component_validator->validateDefinition($definition, TRUE),
      'The invalid component definition did not throw an error.'
    );
  }

  /** * Data provider with valid component definitions. * * @return array * The data. */
Home | Imprint | This part of the site doesn't use cookies.