Code Duplication    Length = 10-11 lines in 3 locations

tests/Doctrine/Tests/ORM/Query/QueryTest.php 3 locations

@@ 312-321 (lines=10) @@
309
    /**
310
     * @group 6699
311
     */
312
    public function testGetParameterTypeJuggling() : void
313
    {
314
        $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id = ?0');
315
316
        $query->setParameter(0, 0);
317
318
        self::assertCount(1, $query->getParameters());
319
        self::assertSame(0, $query->getParameter(0)->getValue());
320
        self::assertSame(0, $query->getParameter('0')->getValue());
321
    }
322
323
    /**
324
     * @group 6699
@@ 326-336 (lines=11) @@
323
    /**
324
     * @group 6699
325
     */
326
    public function testSetParameterWithNameZeroIsNotOverridden() : void
327
    {
328
        $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name');
329
330
        $query->setParameter(0, 0);
331
        $query->setParameter('name', 'Doctrine');
332
333
        self::assertCount(2, $query->getParameters());
334
        self::assertSame(0, $query->getParameter('0')->getValue());
335
        self::assertSame('Doctrine', $query->getParameter('name')->getValue());
336
    }
337
338
    /**
339
     * @group 6699
@@ 341-351 (lines=11) @@
338
    /**
339
     * @group 6699
340
     */
341
    public function testSetParameterWithNameZeroDoesNotOverrideAnotherParameter() : void
342
    {
343
        $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name');
344
345
        $query->setParameter('name', 'Doctrine');
346
        $query->setParameter(0, 0);
347
348
        self::assertCount(2, $query->getParameters());
349
        self::assertSame(0, $query->getParameter(0)->getValue());
350
        self::assertSame('Doctrine', $query->getParameter('name')->getValue());
351
    }
352
353
    /**
354
     * @group 6699