MethodFilter example

class MethodFilterTest extends UnitTestCase {

  /** * @covers ::filter */
  public function testWithAllowedMethod() {
    $request = Request::create('/test', 'GET');
    $collection = new RouteCollection();
    $collection->add('test_route.get', new Route('/test', [][][], '', []['GET']));
    $collection_before = clone $collection;

    $method_filter = new MethodFilter();
    $result_collection = $method_filter->filter($collection$request);

    $this->assertEquals($collection_before$result_collection);
  }

  /** * @covers ::filter */
  public function testWithAllowedMethodAndMultipleMatchingRoutes() {
    $request = Request::create('/test', 'GET');
    $collection = new RouteCollection();
    
Home | Imprint | This part of the site doesn't use cookies.