Code Duplication    Length = 18-21 lines in 2 locations

spec/Router/Builder/RouteFactorySpec.php 2 locations

@@ 42-59 (lines=18) @@
39
        $this->parse('blog.read', '/blog/{id}', $map)->shouldBe($route);
40
        $map->get('blog.read', '/blog/{id}')->shouldHaveBeenCalled();
41
    }
42
    function it_can_parse_complex_route_definitions(
43
        Map $map,
44
        Route $route
45
    )
46
    {
47
        $data = [
48
            'name' => 'blog.edit',
49
            'data' => [
50
                'method' => 'PUT',
51
                'allows' => ['POST'],
52
                'path' => '/blog/{id}/edit'
53
            ],
54
        ];
55
        $map->route($data['name'], $data['data']['path'])->willReturn($route);
56
        $this->parse($data['name'], $data['data'], $map)->shouldBe($route);
57
        $map->route($data['name'], $data['data']['path'])->shouldHaveBeenCalled();
58
        $route->allows(['PUT', 'POST'])->shouldHaveBeenCalled();
59
    }
60
    function it_can_add_all_known_route_properties(
61
        Map $map,
62
        Route $route
@@ 60-80 (lines=21) @@
57
        $map->route($data['name'], $data['data']['path'])->shouldHaveBeenCalled();
58
        $route->allows(['PUT', 'POST'])->shouldHaveBeenCalled();
59
    }
60
    function it_can_add_all_known_route_properties(
61
        Map $map,
62
        Route $route
63
    )
64
    {
65
        $data = [
66
            'name' => 'blog.edit',
67
            'data' => [
68
                'defaults' => [
69
                    'id' => null
70
                ],
71
                'host' => 'www.example.com',
72
                'path' => '/blog/{id}/edit',
73
                'allows' => ['GET', 'POST']
74
            ],
75
        ];
76
        $map->route($data['name'], $data['data']['path'])->willReturn($route);
77
        $this->parse($data['name'], $data['data'], $map)->shouldBe($route);
78
        $route->defaults($data['data']['defaults'])->shouldHaveBeenCalled();
79
        $route->host($data['data']['host'])->shouldHaveBeenCalled();
80
    }
81
82
}