Code Duplication    Length = 14-15 lines in 2 locations

tests/Doctrine/Tests/ORM/QueryBuilderTest.php 2 locations

@@ 527-540 (lines=14) @@
524
        $this->assertSame('value2', $qb->getParameter('field1_1')->getValue());
525
    }
526
527
    public function testAddCriteriaOrder()
528
    {
529
        $qb = $this->_em->createQueryBuilder();
530
        $qb->select('u')
531
            ->from(CmsUser::class, 'u');
532
533
        $criteria = new Criteria();
534
        $criteria->orderBy(['field' => Criteria::DESC]);
535
536
        $qb->addCriteria($criteria);
537
538
        $this->assertCount(1, $orderBy = $qb->getDQLPart('orderBy'));
539
        $this->assertEquals('u.field DESC', (string) $orderBy[0]);
540
    }
541
542
    /**
543
     * @group DDC-3108
@@ 545-559 (lines=15) @@
542
    /**
543
     * @group DDC-3108
544
     */
545
    public function testAddCriteriaOrderOnJoinAlias()
546
    {
547
        $qb = $this->_em->createQueryBuilder();
548
        $qb->select('u')
549
            ->from(CmsUser::class, 'u')
550
            ->join('u.article','a');
551
552
        $criteria = new Criteria();
553
        $criteria->orderBy(['a.field' => Criteria::DESC]);
554
555
        $qb->addCriteria($criteria);
556
557
        $this->assertCount(1, $orderBy = $qb->getDQLPart('orderBy'));
558
        $this->assertEquals('a.field DESC', (string) $orderBy[0]);
559
    }
560
561
    public function testAddCriteriaLimit()
562
    {