Пример #1
0
 /**
  *
  */
 public function testFindWithAcceptableContentType()
 {
     $routePattern1 = new RoutePattern('this/one');
     $routePattern1->setContentType('text/html');
     $routePattern2 = new RoutePattern('this/one');
     $routePattern2->setContentType('application/json');
     $routes = array(new Route($routePattern1, function () {
     }), new Route($routePattern2, function () {
     }));
     $request = new RequestMock();
     $request->setRequestUri('this/one');
     $request->setAcceptableContentTypes(array('application/json'));
     $routeFinder = new RouteFinder(new Container());
     $this->assertSame('application/json', $routeFinder->find($request, $routes)->getPattern()->getContentType());
 }