initializeFieldUsingFactory example

$container->set('plugin.manager.field.field_type', $field_type_manager->reveal());
    $container->set('entity_field.manager', $entity_field_manager->reveal());
    $container->set('typed_data_manager', $typed_data_manager->reveal());
    \Drupal::setContainer($container);
  }

  /** * @covers ::getName * @dataProvider factoryTypeProvider */
  public function testFieldName($factory_name) {
    $definition = $this->initializeFieldUsingFactory($factory_name);
    $this->assertEquals($this->storageDefinition->getName()$definition->getName());
  }

  /** * @covers ::getLabel * @dataProvider factoryTypeProvider */
  public function testFieldLabel($factory_name) {
    $definition = $this->initializeFieldUsingFactory($factory_name);
    $label = $this->randomMachineName();
    $definition->setLabel($label);
    
Home | Imprint | This part of the site doesn't use cookies.