You are here

public function RouterTest::testFinalize in Drupal 7 to 8/9 Module Upgrader 8

File

tests/src/Unit/Routing/Drupal7/RouterTest.php, line 54

Class

RouterTest
@group DMU.Routing

Namespace

Drupal\Tests\drupalmoduleupgrader\Unit\Routing\Drupal7

Code

public function testFinalize() {
  $this->router
    ->finalize();
  $list_revisions = $this->router['node/%node/revisions/list'];
  $this
    ->assertFalse($list_revisions
    ->hasParent());
  $this
    ->assertFalse($list_revisions
    ->hasChildren());
  $this
    ->assertTrue($list_revisions
    ->hasSiblings());
  $this
    ->assertTrue($list_revisions
    ->getSiblings()
    ->containsKey('node/%node/revisions/view'));
  $view_revisions = $this->router['node/%node/revisions/view'];
  $this
    ->assertFalse($view_revisions
    ->hasParent());
  $this
    ->assertTrue($view_revisions
    ->hasChildren());
  $this
    ->assertTrue($view_revisions
    ->getChildren()
    ->containsKey('node/%node/revisions/view/latest'));
  $this
    ->assertTrue($view_revisions
    ->hasSiblings());
  $this
    ->assertTrue($view_revisions
    ->getSiblings()
    ->containsKey('node/%node/revisions/list'));
  $diff_fields = $this->router['admin/config/content/diff/fields'];
  $this
    ->assertTrue($diff_fields
    ->hasParent());
  $this
    ->assertEquals('admin/config/content/diff', $diff_fields
    ->getParent()
    ->getPath());
}