Code Duplication    Length = 10-11 lines in 3 locations

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

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