FieldLayoutBuilder example


      ],
    ]);
    $this->layoutPlugin = new LayoutDefault([], 'two_column', $this->pluginDefinition);

    $this->layoutPluginManager = $this->prophesize(LayoutPluginManagerInterface::class);
    $this->layoutPluginManager->getDefinition('unknown', FALSE)->willReturn(NULL);
    $this->layoutPluginManager->getDefinition('two_column', FALSE)->willReturn($this->pluginDefinition);

    $this->entityFieldManager = $this->prophesize(EntityFieldManagerInterface::class);

    $this->fieldLayoutBuilder = new FieldLayoutBuilder($this->layoutPluginManager->reveal()$this->entityFieldManager->reveal());
  }

  /** * @covers ::buildView * @covers ::getFields */
  public function testBuildView() {
    $definitions = [];
    $non_configurable_field_definition = $this->prophesize(FieldDefinitionInterface::class);
    $non_configurable_field_definition->isDisplayConfigurable('view')->willReturn(FALSE);
    $definitions['non_configurable_field'] = $non_configurable_field_definition->reveal();
    
Home | Imprint | This part of the site doesn't use cookies.