Code Duplication    Length = 15-15 lines in 4 locations

test/ComposerRequireCheckerTest/NodeVisitor/UsedSymbolCollectorTest.php 4 locations

@@ 168-182 (lines=15) @@
165
        $this->assertContains('foo', $symbols);
166
    }
167
168
    public function testFunctionParameterType()
169
    {
170
        $functionName = new Name('foo');
171
        $node = new Function_($functionName);
172
        $node->name = $functionName;
173
        $param = new Param('bar');
174
        $param->type = new Name('Baz');
175
        $node->params = [$param];
176
177
        $this->visitor->enterNode($node);
178
179
        $symbols = $this->visitor->getCollectedSymbols();
180
        $this->assertCount(1, $symbols);
181
        $this->assertContains('Baz', $symbols);
182
    }
183
184
    public function testFunctionParameterTypeAsString()
185
    {
@@ 184-198 (lines=15) @@
181
        $this->assertContains('Baz', $symbols);
182
    }
183
184
    public function testFunctionParameterTypeAsString()
185
    {
186
        $functionName = new Name('foo');
187
        $node = new Function_($functionName);
188
        $node->name = $functionName;
189
        $param = new Param('bar');
190
        $param->type = 'Baz';
191
        $node->params = [$param];
192
193
        $this->visitor->enterNode($node);
194
195
        $symbols = $this->visitor->getCollectedSymbols();
196
        $this->assertCount(1, $symbols);
197
        $this->assertContains('Baz', $symbols);
198
    }
199
200
    public function testMethodParameterType()
201
    {
@@ 200-214 (lines=15) @@
197
        $this->assertContains('Baz', $symbols);
198
    }
199
200
    public function testMethodParameterType()
201
    {
202
        $functionName = new Name('foo');
203
        $node = new ClassMethod($functionName);
204
        $node->name = $functionName;
205
        $param = new Param('bar');
206
        $param->type = new Name('Baz');
207
        $node->params = [$param];
208
209
        $this->visitor->enterNode($node);
210
211
        $symbols = $this->visitor->getCollectedSymbols();
212
        $this->assertCount(1, $symbols);
213
        $this->assertContains('Baz', $symbols);
214
    }
215
216
    public function testMethodParameterTypeAsString()
217
    {
@@ 216-230 (lines=15) @@
213
        $this->assertContains('Baz', $symbols);
214
    }
215
216
    public function testMethodParameterTypeAsString()
217
    {
218
        $functionName = new Name('foo');
219
        $node = new ClassMethod($functionName);
220
        $node->name = $functionName;
221
        $param = new Param('bar');
222
        $param->type = 'Baz';
223
        $node->params = [$param];
224
225
        $this->visitor->enterNode($node);
226
227
        $symbols = $this->visitor->getCollectedSymbols();
228
        $this->assertCount(1, $symbols);
229
        $this->assertContains('Baz', $symbols);
230
    }
231
232
    public function testFunctionReturnType()
233
    {