You are here

public function RoutingFixtures::staticSampleRouteCollection in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php \Drupal\Tests\Core\Routing\RoutingFixtures::staticSampleRouteCollection()

Returns a static version of the routes.

File

core/tests/Drupal/Tests/Core/Routing/RoutingFixtures.php, line 54
Contains \Drupal\Tests\Core\Routing\RoutingFixtures.

Class

RoutingFixtures
Utility methods to generate sample data, database configuration, etc.

Namespace

Drupal\Tests\Core\Routing

Code

public function staticSampleRouteCollection() {
  $routes = array();
  $routes['route_a'] = array(
    'path' => '/path/one',
    'methods' => array(
      'GET',
    ),
  );
  $routes['route_b'] = array(
    'path' => '/path/one',
    'methods' => array(
      'PUT',
    ),
  );
  $routes['route_c'] = array(
    'path' => '/path/two',
    'methods' => array(
      'GET',
    ),
    'requirements' => array(
      '_format' => 'json',
    ),
  );
  $routes['route_d'] = array(
    'path' => '/path/three',
  );
  $routes['route_e'] = array(
    'path' => '/path/two',
    'methods' => array(
      'GET',
      'HEAD',
    ),
    'requirements' => array(
      '_format' => 'html',
    ),
  );
  return $routes;
}