loadComponentDefinitionFromFs example

$component_validator->setValidator();
    $component_validator->validateDefinition($definition, TRUE);
  }

  /** * Data provider with invalid component definitions. * * @return array * The data. */
  public static function dataProviderValidateDefinitionInvalid(): array {
    $valid_cta = static::loadComponentDefinitionFromFs('my-cta');
    $cta_with_missing_required = $valid_cta;
    unset($cta_with_missing_required['path']);
    $cta_with_invalid_class = $valid_cta;
    $cta_with_invalid_class['props']['properties']['attributes']['type'] = 'Drupal\Foo\Invalid';
    $cta_with_invalid_enum = array_merge(
      $valid_cta,
      ['extension_type' => 'invalid'],
    );
    return [
      [$cta_with_missing_required],
      [$cta_with_invalid_class],
      [
Home | Imprint | This part of the site doesn't use cookies.