getDescription example

static::assertSame('https://payment.app/payment/finalize', $firstWebhook->getFinalizeUrl());
        static::assertSame('https://payment.app/payment/refund', $firstWebhook->getRefundUrl());
        static::assertSame('https://payment.app/payment/recurring', $firstWebhook->getRecurringUrl());
        static::assertSame('Resources/payment.png', $firstWebhook->getIcon());
        static::assertSame([
            'en-GB' => 'The app payment method',
            'de-DE' => 'Die App Zahlungsmethode',
        ]$firstWebhook->getName());
        static::assertSame([
            'en-GB' => 'This is a description',
            'de-DE' => 'Die Zahlungsmethoden-Beschreibung',
        ]$firstWebhook->getDescription());

        $secondWebhook = $manifest->getPayments()->getPaymentMethods()[1];
        static::assertNotNull($secondWebhook);
        static::assertSame('anotherMethod', $secondWebhook->getIdentifier());
        static::assertNull($secondWebhook->getPayUrl());
        static::assertNull($secondWebhook->getFinalizeUrl());
        static::assertNull($secondWebhook->getRefundUrl());
        static::assertNull($secondWebhook->getRecurringUrl());
        static::assertNull($secondWebhook->getIcon());
        static::assertSame([
            'en-GB' => 'Another app payment method',
        ],


  /** * {@inheritdoc} */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $form = parent::buildForm($form$form_state);

    $form['#title'] = $this->getQuestion();

    $form['#attributes']['class'][] = 'confirmation';
    $form['description'] = ['#markup' => $this->getDescription()];
    $form[$this->getFormName()] = ['#type' => 'hidden', '#value' => 1];

    // By default, render the form using theme_confirm_form().     if (!isset($form['#theme'])) {
      $form['#theme'] = 'confirm_form';
    }
    return $form;
  }

  /** * {@inheritdoc} */

                'en-GB' => 'First action app',
                'de-DE' => 'First action app DE',
            ],
            $firstAction->getMeta()->getLabel()
        );
        static::assertEquals(
            [
                'en-GB' => 'First action app description',
                'de-DE' => 'First action app description DE',
            ],
            $firstAction->getMeta()->getDescription()
        );
        static::assertEquals(
            [
                'en-GB' => 'Headline for action',
                'de-DE' => 'Überschrift für Aktion',
            ],
            $firstAction->getMeta()->getHeadline()
        );
    }
}
/** * Converts a configurator group struct which used for default or selection configurators. * * @return array */
    public function convertConfiguratorGroupStruct(Group $group)
    {
        $data = [
            'groupID' => $group->getId(),
            'groupname' => $group->getName(),
            'groupdescription' => $group->getDescription(),
            'selected_value' => null,
            'selected' => $group->isSelected(),
            'user_selected' => $group->isSelected(),
            'attributes' => $group->getAttributes(),
        ];

        if ($group->hasAttribute('core')) {
            $data['attribute'] = $group->getAttribute('core');
        }

        return $this->eventManager->filter('Legacy_Struct_Converter_Convert_Configurator_Group', $data[
            

        $dom = new \DOMDocument('1.0', 'UTF-8');
        $dom->appendChild($commandXML = $dom->createElement('command'));

        $commandXML->setAttribute('id', $command->getName());
        $commandXML->setAttribute('name', $command->getName());
        $commandXML->setAttribute('hidden', $command->isHidden() ? 1 : 0);

        $commandXML->appendChild($usagesXML = $dom->createElement('usages'));

        $commandXML->appendChild($descriptionXML = $dom->createElement('description'));
        $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getDescription())));

        if ($short) {
            foreach ($command->getAliases() as $usage) {
                $usagesXML->appendChild($dom->createElement('usage', $usage));
            }
        } else {
            $command->mergeApplicationDefinition(false);

            foreach (array_merge([$command->getSynopsis()]$command->getAliases()$command->getUsages()) as $usage) {
                $usagesXML->appendChild($dom->createElement('usage', $usage));
            }

            
/** * @param \ReflectionClass<object> $reflection */
    public function getGroupForService(\ReflectionClass $reflection): string
    {
        $docBlock = $this->docFactory->create($reflection);

        /** @var Generic[] $tags */
        $tags = $docBlock->getTagsByName('script-service');

        $description = $tags[0]->getDescription();

        if (!$description || !\in_array($description->render()array_keys(self::GROUPS), true)) {
            throw new \RuntimeException(sprintf(
                'Script Services "%s" is not correctly tagged to the group. Available groups are: "%s".',
                $reflection->getName(),
                implode('", "', array_keys(self::GROUPS)),
            ));
        }

        return $description->render();
    }

    


    protected function write(string $content, bool $decorated = true): void
    {
        parent::write($content$decorated);
    }

    protected function describeInputArgument(InputArgument $argument, array $options = []): void
    {
        $this->write(
            '#### `'.($argument->getName() ?: '<none>')."`\n\n"
            .($argument->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $argument->getDescription())."\n\n" : '')
            .'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n"
            .'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n"
            .'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`'
        );
    }

    protected function describeInputOption(InputOption $option, array $options = []): void
    {
        $name = '--'.$option->getName();
        if ($option->isNegatable()) {
            $name .= '|--no-'.$option->getName();
        }

  protected function assertEntity(string $id, string $expected_label, string $expected_description, int $expected_weight): void {
    /** @var \Drupal\taxonomy\VocabularyInterface $entity */
    $entity = Vocabulary::load($id);
    $this->assertInstanceOf(VocabularyInterface::class$entity);
    $this->assertSame($expected_label$entity->label());
    $this->assertSame($expected_description$entity->getDescription());
    $this->assertSame($expected_weight(int) $entity->get('weight'));
  }

  /** * Tests the Drupal 7 taxonomy vocabularies to Drupal 8 migration. */
  public function testTaxonomyVocabulary() {
    $this->assertEntity('tags', 'Tags', 'Use tags to group articles on similar topics into categories.', 0);
    $this->assertEntity('forums', 'Sujet de discussion', 'Forum navigation vocabulary', -10);
    $this->assertEntity('test_vocabulary', 'Test Vocabulary', 'This is the vocabulary description', 0);
    $this->assertEntity('vocabulary_name_much_longer_th', 'vocabulary name clearly different than machine name and much longer than thirty two characters', 'description of vocabulary name much longer than thirty two characters', 0);
  }

  protected function assertEntity($id$langcode$title$menu$description$enabled$expanded, array $attributes$uri$weight) {
    /** @var \Drupal\menu_link_content\MenuLinkContentInterface $menu_link */
    $menu_link = MenuLinkContent::load($id);
    $menu_link = $menu_link->getTranslation($langcode);
    $this->assertInstanceOf(MenuLinkContentInterface::class$menu_link);
    $this->assertSame($title$menu_link->getTitle());
    $this->assertSame($langcode$menu_link->language()->getId());
    $this->assertSame($menu$menu_link->getMenuName());
    $this->assertSame($description$menu_link->getDescription());
    $this->assertSame($enabled$menu_link->isEnabled());
    $this->assertSame($expanded$menu_link->isExpanded());
    $this->assertSame($attributes$menu_link->link->options);
    $this->assertSame($uri$menu_link->link->uri);
    $this->assertSame($weight$menu_link->getWeight());
    return $menu_link;
  }

}
$slot = new CmsSlotEntity();
        $slot->setUniqueIdentifier('id');
        $slot->setType('text');
        $slot->setConfig([]);
        $slot->setFieldConfig($fieldConfig);

        $this->textResolver->enrich($slot$resolverContext$result);

        /** @var TextStruct|null $textStruct */
        $textStruct = $slot->getData();
        static::assertInstanceOf(TextStruct::class$textStruct);
        static::assertSame($product->getDescription()$textStruct->getContent());
    }

    public function testWithMappedContentAndTranslationFallback(): void
    {
        $product = new ProductEntity();
        $product->setTranslated(['description' => 'fallback foo']);

        $resolverContext = new EntityResolverContext($this->createMock(SalesChannelContext::class)new Request()$this->createMock(ProductDefinition::class)$product);
        $result = new ElementDataCollection();

        $fieldConfig = new FieldConfigCollection();
        


  /** * @covers ::getDefinition * @covers ::processDefinition */
  public function testGetDefinition() {
    $layout_definition = $this->layoutPluginManager->getDefinition('theme_a_provided_layout');
    $this->assertSame('theme_a_provided_layout', $layout_definition->id());
    $this->assertSame('2 column layout', (string) $layout_definition->getLabel());
    $this->assertSame('Columns: 2', (string) $layout_definition->getCategory());
    $this->assertSame('A theme provided layout', (string) $layout_definition->getDescription());
    $this->assertInstanceOf(TranslatableMarkup::class$layout_definition->getLabel());
    $this->assertInstanceOf(TranslatableMarkup::class$layout_definition->getCategory());
    $this->assertInstanceOf(TranslatableMarkup::class$layout_definition->getDescription());
    $this->assertSame('twocol', $layout_definition->getTemplate());
    $this->assertSame('themes/theme_a/templates', $layout_definition->getPath());
    $this->assertSame('theme_a/twocol', $layout_definition->getLibrary());
    $this->assertSame('twocol', $layout_definition->getThemeHook());
    $this->assertSame('themes/theme_a/templates', $layout_definition->getTemplatePath());
    $this->assertSame('theme_a', $layout_definition->getProvider());
    $this->assertSame('right', $layout_definition->getDefaultRegion());
    $this->assertSame(LayoutDefault::class$layout_definition->getClass());
    
'#type' => 'machine_name',
      '#default_value' => $vocabulary->id(),
      '#maxlength' => EntityTypeInterface::BUNDLE_MAX_LENGTH,
      '#machine_name' => [
        'exists' => [$this, 'exists'],
        'source' => ['name'],
      ],
    ];
    $form['description'] = [
      '#type' => 'textfield',
      '#title' => $this->t('Description'),
      '#default_value' => $vocabulary->getDescription(),
    ];

    // $form['langcode'] is not wrapped in an     // if ($this->moduleHandler->moduleExists('language')) check because the     // language_select form element works also without the language module being     // installed. https://www.drupal.org/node/1749954 documents the new element.     $form['langcode'] = [
      '#type' => 'language_select',
      '#title' => $this->t('Vocabulary language'),
      '#languages' => LanguageInterface::STATE_ALL,
      '#default_value' => $vocabulary->language()->getId(),
    ];
$this->assertSame('Link Field', $field->label());
    $expected = ['title' => 2, 'link_type' => LinkItemInterface::LINK_GENERIC];
    $this->assertSame($expected$field->getSettings());
    $this->assertSame('default link title', $entity->field_test_link->title, 'Field field_test_link default title is correct.');
    $this->assertSame('https://www.drupal.org', $entity->field_test_link->uri);
    $this->assertSame([]$entity->field_test_link->options['attributes']);

    // Test date field.     $field = FieldConfig::load('node.story.field_test_date');
    $this->assertInstanceOf(FieldConfig::class$field);
    $this->assertSame('Date Field', $field->label());
    $this->assertSame('An example date field.', $field->getDescription());
    $expected = ['datetime_type' => 'datetime'];
    $this->assertSame($expected$field->getSettings());
    $expected = [
      [
        'default_date_type' => 'relative',
        'default_date' => 'blank',
      ],
    ];
    $this->assertSame($expected$field->getDefaultValueLiteral());
    $this->assertTrue($field->isTranslatable());

    
/** * @return Form */
    private function initForm(Plugin $plugin)
    {
        $form = new Form();
        $form->setPluginId($plugin->getId());

        $form->setName($plugin->getName());
        $form->setLabel($plugin->getLabel());
        $form->setDescription($plugin->getDescription());

        /** @var Form $parent */
        $parent = $this->formRepository->findOneBy([
            'name' => strpos($plugin->getName(), 'Payment') !== false ? 'Payment' : 'Other',
        ]);

        $form->setParent($parent);
        $this->em->persist($form);

        return $form;
    }

    
'#maxlength' => 32,
      '#disabled' => !$this->entity->isNew(),
      '#machine_name' => [
        'exists' => [MediaType::class, 'load'],
      ],
      '#description' => $this->t('A unique machine-readable name for this media type.'),
    ];

    $form['description'] = [
      '#title' => $this->t('Description'),
      '#type' => 'textarea',
      '#default_value' => $this->entity->getDescription(),
      '#description' => $this->t('Describe this media type. The text will be displayed on the <em>Add new media</em> page.'),
    ];

    $plugins = $this->sourceManager->getDefinitions();
    $options = [];
    foreach ($plugins as $plugin_id => $definition) {
      $options[$plugin_id] = $definition['label'];
    }

    $form['source_dependent'] = [
      '#type' => 'container',
      
Home | Imprint | This part of the site doesn't use cookies.