Code Duplication    Length = 8-8 lines in 4 locations

tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php 4 locations

@@ 698-705 (lines=8) @@
695
    /**
696
     * @group DDC-1500
697
     */
698
    public function testInvalidOrientation()
699
    {
700
        $this->expectException(ORMException::class);
701
        $this->expectExceptionMessage('Invalid order by orientation specified for Doctrine\Tests\Models\CMS\CmsUser#username');
702
703
        $repo = $this->em->getRepository(CmsUser::class);
704
        $repo->findBy(['status' => 'test'], ['username' => 'INVALID']);
705
    }
706
707
    /**
708
     * @group DDC-1713
@@ 991-998 (lines=8) @@
988
    /**
989
     * @group DDC-3045
990
     */
991
    public function testFindByFieldInjectionPrevented()
992
    {
993
        $this->expectException(ORMException::class);
994
        $this->expectExceptionMessage('Unrecognized field: ');
995
996
        $repository = $this->em->getRepository(CmsUser::class);
997
        $repository->findBy(['username = ?; DELETE FROM cms_users; SELECT 1 WHERE 1' => 'test']);
998
    }
999
1000
    /**
1001
     * @group DDC-3045
@@ 1003-1010 (lines=8) @@
1000
    /**
1001
     * @group DDC-3045
1002
     */
1003
    public function testFindOneByFieldInjectionPrevented()
1004
    {
1005
        $this->expectException(ORMException::class);
1006
        $this->expectExceptionMessage('Unrecognized field: ');
1007
1008
        $repository = $this->em->getRepository(CmsUser::class);
1009
        $repository->findOneBy(['username = ?; DELETE FROM cms_users; SELECT 1 WHERE 1' => 'test']);
1010
    }
1011
1012
    /**
1013
     * @group DDC-3045
@@ 1032-1039 (lines=8) @@
1029
    /**
1030
     * @group DDC-3045
1031
     */
1032
    public function testFindInjectionPrevented()
1033
    {
1034
        $this->expectException(ORMException::class);
1035
        $this->expectExceptionMessage('Unrecognized identifier fields: ');
1036
1037
        $repository = $this->em->getRepository(CmsUser::class);
1038
        $repository->find(['username = ?; DELETE FROM cms_users; SELECT 1 WHERE 1' => 'test', 'id' => 1]);
1039
    }
1040
1041
    /**
1042
     * @group DDC-3056