Code Duplication    Length = 8-8 lines in 4 locations

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

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