Code Duplication    Length = 22-23 lines in 7 locations

eZ/Publish/Core/MVC/Symfony/SiteAccess/Tests/RouterURITextTest.php 1 location

@@ 129-151 (lines=23) @@
126
        $this->assertSame("/foosomethingbar{$semanticURI}", $request->pathinfo);
127
    }
128
129
    protected function createRouter(): Router
130
    {
131
        return new Router(
132
            $this->matcherBuilder,
133
            $this->createMock(LoggerInterface::class),
134
            'default_sa',
135
            [
136
                'URIText' => [
137
                    'prefix' => 'foo',
138
                    'suffix' => 'bar',
139
                ],
140
                'Map\\URI' => [
141
                    'first_sa' => 'first_sa',
142
                    'second_sa' => 'second_sa',
143
                ],
144
                'Map\\Host' => [
145
                    'first_sa' => 'first_sa',
146
                    'first_siteaccess' => 'first_sa',
147
                ],
148
            ],
149
            $this->siteAccessProvider
150
        );
151
    }
152
153
    /**
154
     * @return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Tests\SiteAccessSetting[]

eZ/Publish/Core/MVC/Symfony/SiteAccess/Tests/RouterHostElementTest.php 1 location

@@ 128-150 (lines=23) @@
125
        $this->assertSame($serializedSA1, $serializedSA2);
126
    }
127
128
    protected function createRouter(): Router
129
    {
130
        return new Router(
131
            $this->matcherBuilder,
132
            $this->createMock(LoggerInterface::class),
133
            'default_sa',
134
            [
135
                'HostElement' => [
136
                    'value' => 2,
137
                ],
138
                'Map\\URI' => [
139
                    'first_sa' => 'first_sa',
140
                    'second_sa' => 'second_sa',
141
                ],
142
                'Map\\Host' => [
143
                    'first_sa' => 'first_sa',
144
                    'first_siteaccess' => 'first_sa',
145
                    'second_sa' => 'second_sa',
146
                ],
147
            ],
148
            $this->siteAccessProvider
149
        );
150
    }
151
152
    /**
153
     * @return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Tests\SiteAccessSetting[]

eZ/Publish/Core/MVC/Symfony/SiteAccess/Tests/RouterHostRegexTest.php 1 location

@@ 83-104 (lines=22) @@
80
    /**
81
     * @return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Router
82
     */
83
    protected function createRouter(): Router
84
    {
85
        return new Router(
86
            $this->matcherBuilder,
87
            $this->createMock(LoggerInterface::class),
88
            'default_sa',
89
            [
90
                'Regex\\Host' => [
91
                    'regex' => '^(\\w+_sa)$',
92
                ],
93
                'Map\\URI' => [
94
                    'first_sa' => 'first_sa',
95
                    'second_sa' => 'second_sa',
96
                ],
97
                'Map\\Host' => [
98
                    'first_sa' => 'first_sa',
99
                    'first_siteaccess' => 'first_sa',
100
                ],
101
            ],
102
            $this->siteAccessProvider
103
        );
104
    }
105
106
    /**
107
     * @return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Tests\SiteAccessSetting[]

eZ/Publish/Core/MVC/Symfony/SiteAccess/Tests/RouterHostTextTest.php 1 location

@@ 97-119 (lines=23) @@
94
        $this->assertSame('www.foobar.com', $request->host);
95
    }
96
97
    protected function createRouter(): Router
98
    {
99
        return new Router(
100
            $this->matcherBuilder,
101
            $this->createMock(LoggerInterface::class),
102
            'default_sa',
103
            [
104
                'HostText' => [
105
                    'prefix' => 'www.',
106
                    'suffix' => '.com',
107
                ],
108
                'Map\\URI' => [
109
                    'first_sa' => 'first_sa',
110
                    'second_sa' => 'second_sa',
111
                ],
112
                'Map\\Host' => [
113
                    'first_sa' => 'first_sa',
114
                    'first_siteaccess' => 'first_sa',
115
                ],
116
            ],
117
            $this->siteAccessProvider
118
        );
119
    }
120
121
    /**
122
     * @return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Tests\SiteAccessSetting[]

eZ/Publish/Core/MVC/Symfony/SiteAccess/Tests/RouterURIElement2Test.php 1 location

@@ 179-200 (lines=22) @@
176
        $this->assertSame($serializedSA1, $serializedSA2);
177
    }
178
179
    protected function createRouter(): Router
180
    {
181
        return new Router(
182
            $this->matcherBuilder,
183
            $this->createMock(LoggerInterface::class),
184
            'default_sa',
185
            [
186
                'URIElement' => [
187
                    'value' => 2,
188
                ],
189
                'Map\\URI' => [
190
                    'first_sa' => 'first_sa',
191
                    'second_sa' => 'second_sa',
192
                ],
193
                'Map\\Host' => [
194
                    'first_sa' => 'first_sa',
195
                    'first_siteaccess' => 'first_sa',
196
                ],
197
            ],
198
            $this->siteAccessProvider
199
        );
200
    }
201
202
    /**
203
     * @return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Tests\SiteAccessSetting[]

eZ/Publish/Core/MVC/Symfony/SiteAccess/Tests/RouterURIElementTest.php 1 location

@@ 151-172 (lines=22) @@
148
        $this->assertSame($serializedSA1, $serializedSA2);
149
    }
150
151
    protected function createRouter(): Router
152
    {
153
        return new Router(
154
            $this->matcherBuilder,
155
            $this->createMock(LoggerInterface::class),
156
            'default_sa',
157
            [
158
                'URIElement' => [
159
                    'value' => 1,
160
                ],
161
                'Map\\URI' => [
162
                    'first_sa' => 'first_sa',
163
                    'second_sa' => 'second_sa',
164
                ],
165
                'Map\\Host' => [
166
                    'first_sa' => 'first_sa',
167
                    'first_siteaccess' => 'first_sa',
168
                ],
169
            ],
170
            $this->siteAccessProvider
171
        );
172
    }
173
174
    /**
175
     * @return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Tests\SiteAccessSetting[]

eZ/Publish/Core/MVC/Symfony/SiteAccess/Tests/RouterURIRegexTest.php 1 location

@@ 101-122 (lines=22) @@
98
        $this->assertSame($serializedSA1, $serializedSA2);
99
    }
100
101
    protected function createRouter(): Router
102
    {
103
        return new Router(
104
            $this->matcherBuilder,
105
            $this->createMock(LoggerInterface::class),
106
            'default_sa',
107
            [
108
                'Regex\\URI' => [
109
                    'regex' => '^/foo(\\w+)bar',
110
                ],
111
                'Map\\URI' => [
112
                    'first_sa' => 'first_sa',
113
                    'second_sa' => 'second_sa',
114
                ],
115
                'Map\\Host' => [
116
                    'first_sa' => 'first_sa',
117
                    'first_siteaccess' => 'first_sa',
118
                ],
119
            ],
120
            $this->siteAccessProvider
121
        );
122
    }
123
124
    /**
125
     * @return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Tests\SiteAccessSetting[]