function FieldUiTest::testGetNextDestinationRouteName

Same name and namespace in other branches
  1. 9 core/modules/field_ui/tests/src/Unit/FieldUiTest.php \Drupal\Tests\field_ui\Unit\FieldUiTest::testGetNextDestinationRouteName()
  2. 8.9.x core/modules/field_ui/tests/src/Unit/FieldUiTest.php \Drupal\Tests\field_ui\Unit\FieldUiTest::testGetNextDestinationRouteName()
  3. 11.x core/modules/field_ui/tests/src/Unit/FieldUiTest.php \Drupal\Tests\field_ui\Unit\FieldUiTest::testGetNextDestinationRouteName()

@covers ::getNextDestination

File

core/modules/field_ui/tests/src/Unit/FieldUiTest.php, line 63

Class

FieldUiTest
@coversDefaultClass \Drupal\field_ui\FieldUI[[api-linebreak]]

Namespace

Drupal\Tests\field_ui\Unit

Code

public function testGetNextDestinationRouteName() : void {
  $destinations = [
    [
      'route_name' => 'system.admin',
    ],
    [
      'route_name' => 'system.admin_content',
    ],
  ];
  $expected_route_name = 'system.admin';
  $expected_query = [
    'destinations' => [
      [
        'route_name' => 'system.admin_content',
      ],
    ],
  ];
  $actual = FieldUI::getNextDestination($destinations);
  $this->assertSame($expected_route_name, $actual->getRouteName());
  $this->assertSame($expected_query, $actual->getOption('query'));
}

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