/**
  * Tests if adding a requirement to a route only modify one route.
  */
 public function testRoutesRequirements()
 {
     $this->restExport->collectRoutes($this->routes);
     $requirements_1 = $this->routes->get('test_1')->getRequirements();
     $requirements_2 = $this->routes->get('view.test_view.page_1')->getRequirements();
     $this->assertEquals(count($requirements_1), 0, 'First route has no requirement.');
     $this->assertEquals(count($requirements_2), 2, 'Views route with rest export had the format and method requirements added.');
 }
예제 #2
0
 /**
  * Tests if adding a requirement to a route only modify one route.
  */
 public function testRoutesRequirements()
 {
     $this->restExport->collectRoutes($this->routes);
     $requirements_1 = $this->routes->get('test_1')->getRequirements();
     $requirements_2 = $this->routes->get('view.test_view.page_1')->getRequirements();
     $this->assertEquals(count($requirements_1), 0, 'First route has no requirement.');
     $this->assertEquals(count($requirements_2), 2, 'Views route with rest export had the format and method requirements added.');
     // Check auth options.
     $auth = $this->routes->get('view.test_view.page_1')->getOption('_auth');
     $this->assertEquals(count($auth), 1, 'View route with rest export has an auth option added');
     $this->assertEquals($auth[0], 'basic_auth', 'View route with rest export has the correct auth option added');
 }