getBaseFieldStorage example

/** * @covers ::defineOptions */
  public function testDefineOptionsWithNoOptions() {
    $definition = [
      'entity_type' => 'test_entity',
      'field_name' => 'title',
    ];
    $handler = new EntityField([], 'field', $definition$this->entityTypeManager, $this->formatterPluginManager, $this->fieldTypePluginManager, $this->languageManager, $this->renderer, $this->entityRepository, $this->entityFieldManager);

    // Setup the entity field manager to allow fetching the storage definitions.     $title_storage = $this->getBaseFieldStorage();

    $this->entityFieldManager->expects($this->atLeastOnce())
      ->method('getFieldStorageDefinitions')
      ->with('test_entity')
      ->willReturn([
        'title' => $title_storage,
      ]);

    $options = [];
    $handler->init($this->executable, $this->display, $options);

    
Home | Imprint | This part of the site doesn't use cookies.