createTextField example

$type->save();
    $this->createEntityReferenceField(
      'node',
      'article',
      'field_tags',
      'Tags',
      'taxonomy_term',
      'default',
      ['target_bundles' => ['tags']],
      FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED
    );
    $this->createTextField('node', 'article', 'body', 'Body');

    $this->createImageField('field_image', 'article');

    $this->user = User::create([
      'name' => 'user1',
      'mail' => 'user@localhost',
    ]);
    $this->user2 = User::create([
      'name' => 'user2',
      'mail' => 'user2@localhost',
    ]);

    
    $this->installSchema('system', ['sequences']);
    $this->installSchema('node', ['node_access']);
    $this->installSchema('user', ['users_data']);
    $this->user = User::create([
      'name' => $this->randomString(),
      'status' => 1,
    ]);
    $this->user->save();
    NodeType::create([
      'type' => 'foo',
    ])->save();
    $this->createTextField('node', 'foo', 'field_text', 'Text');
    $this->node = Node::create([
      'title' => 'Test Node',
      'type' => 'foo',
      'field_text' => [
        'value' => 'This is some text.',
        'format' => 'text_plain',
      ],
      'uid' => $this->user->id(),
    ]);
    $this->node->save();
    $this->container->setAlias('sut', 'jsonapi.serializer');
    
'attributes' => ['autoScroll' => true]]
        );

        $attributes = array_merge($this->fieldSetDefaults, ['height' => 170]);
        $fieldSetBasic = $this->createFieldSet(
            'typo_base',
            '__responsive_tab_typo_fieldset_base__',
            ['attributes' => $attributes]
        );

        $fieldSetBasic->addElement(
            $this->createTextField(
                'font-base-stack',
                '@font-base-stack',
                $this->themeFontDefaults['font-base-stack']
            )
        );
        $fieldSetBasic->addElement(
            $this->createTextField(
                'font-headline-stack',
                '@font-headline-stack',
                $this->themeFontDefaults['font-headline-stack']
            )
        );
$this->installEntitySchema($entity_type_id);
    }
  }

  /** * Creates a painting node type. */
  protected function savePaintingType() {
    NodeType::create([
      'type' => 'painting',
    ])->save();
    $this->createTextField(
      'node', 'painting',
      'colors', 'Colors',
      FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED
    );
    $this->createTextField(
      'node', 'painting',
      'shapes', 'Shapes',
      FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED
    );
    $this->createImageField('photo', 'painting');
  }

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