You are here

public function RouteWrapperTest::testUnwrap in Drupal 7 to 8/9 Module Upgrader 8

File

tests/src/Unit/Routing/Drupal7/RouteWrapperTest.php, line 35

Class

RouteWrapperTest
@group DMU.Routing

Namespace

Drupal\Tests\drupalmoduleupgrader\Unit\Routing\Drupal7

Code

public function testUnwrap() {
  $route = [
    'title' => 'List revisions',
    'page callback' => 'diff_diffs_overview',
    'type' => 'MENU_DEFAULT_LOCAL_TASK',
    'access callback' => 'diff_node_revision_access',
    'access arguments' => [
      1,
    ],
    'file' => 'diff.pages.inc',
  ];
  $unwrapped_route = $this
    ->getMockRouteWrapper()
    ->unwrap();
  $this
    ->assertTrue(is_array($unwrapped_route));
  foreach ($route as $key => $value) {
    $this
      ->assertArrayHasKey($key, $unwrapped_route);
    $this
      ->assertEquals($value, $unwrapped_route[$key]);
  }
}