You are here

class FieldFormatterSettingsSummaryAlterEventTest in Hook Event Dispatcher 8.2

Same name and namespace in other branches
  1. 3.x modules/field_event_dispatcher/tests/src/Unit/Field/FieldFormatterSettingsSummaryAlterEventTest.php \Drupal\Tests\field_event_dispatcher\Unit\Field\FieldFormatterSettingsSummaryAlterEventTest

Class FieldFormatterSettingsSummaryAlterEventTest.

@group field_event_dispatcher

Hierarchy

Expanded class hierarchy of FieldFormatterSettingsSummaryAlterEventTest

File

modules/field_event_dispatcher/tests/src/Unit/Field/FieldFormatterSettingsSummaryAlterEventTest.php, line 14

Namespace

Drupal\Tests\field_event_dispatcher\Unit\Field
View source
class FieldFormatterSettingsSummaryAlterEventTest extends AbstractFieldSettingsSummaryAlterEventTestCase {

  /**
   * {@inheritdoc}
   */
  protected function getProceduralHookName() : string {
    return 'field_event_dispatcher_field_formatter_settings_summary_alter';
  }

  /**
   * {@inheritdoc}
   */
  protected function getEventName() : string {
    return HookEventDispatcherInterface::FIELD_FORMATTER_SETTINGS_SUMMARY_ALTER;
  }

  /**
   * {@inheritdoc}
   */
  protected function getTestContext(BaseFieldDefinition $fieldDefinition) : array {
    return [
      'formatter' => new BasicStringFormatter('test_formatter', [], $fieldDefinition, [], 'label', 'view_mode', []),
      'view_mode' => 'test',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractFieldSettingsSummaryAlterEventTestCase::$manager private property The manager.
AbstractFieldSettingsSummaryAlterEventTestCase::setUp public function Sets up the test.
AbstractFieldSettingsSummaryAlterEventTestCase::testAddSummary public function AbstractFieldSettingsSummaryAlterEventTestCase adding summary test.
AbstractFieldSettingsSummaryAlterEventTestCase::testContext public function AbstractFieldSettingsSummaryAlterEventTestCase context test.
FieldFormatterSettingsSummaryAlterEventTest::getEventName protected function Get the name of the event to test. Overrides AbstractFieldSettingsSummaryAlterEventTestCase::getEventName
FieldFormatterSettingsSummaryAlterEventTest::getProceduralHookName protected function Get the name of the procedural hook function for this test. Overrides AbstractFieldSettingsSummaryAlterEventTestCase::getProceduralHookName
FieldFormatterSettingsSummaryAlterEventTest::getTestContext protected function Get the test context array. Overrides AbstractFieldSettingsSummaryAlterEventTestCase::getTestContext