function MigrateFieldFormatterSettingsTest::assertComponent

Same name in other branches
  1. 9 core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php \Drupal\Tests\field\Kernel\Migrate\d7\MigrateFieldFormatterSettingsTest::assertComponent()
  2. 8.9.x core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php \Drupal\Tests\field\Kernel\Migrate\d7\MigrateFieldFormatterSettingsTest::assertComponent()
  3. 10 core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php \Drupal\Tests\field\Kernel\Migrate\d7\MigrateFieldFormatterSettingsTest::assertComponent()

Asserts various aspects of a particular component of a view display.

@internal

Parameters

string $display_id: The view display ID.

string $component_id: The component ID.

string $type: The expected component type (formatter plugin ID).

string $label: The expected label of the component.

int $weight: The expected weight of the component.

1 call to MigrateFieldFormatterSettingsTest::assertComponent()
MigrateFieldFormatterSettingsTest::testMigration in core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php
Tests migration of D7 field formatter settings.

File

core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php, line 75

Class

MigrateFieldFormatterSettingsTest
Tests migration of D7 field formatter settings.

Namespace

Drupal\Tests\field\Kernel\Migrate\d7

Code

protected function assertComponent(string $display_id, string $component_id, string $type, string $label, int $weight) : void {
    $component = EntityViewDisplay::load($display_id)->getComponent($component_id);
    $this->assertIsArray($component);
    $this->assertSame($type, $component['type']);
    $this->assertSame($label, $component['label']);
    $this->assertSame($weight, $component['weight']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.