@@ 661-668 (lines=8) @@ | ||
658 | /** |
|
659 | * @group DDC-1500 |
|
660 | */ |
|
661 | public function testInvalidOrientation() |
|
662 | { |
|
663 | $this->expectException(ORMException::class); |
|
664 | $this->expectExceptionMessage('Invalid order by orientation specified for Doctrine\Tests\Models\CMS\CmsUser#username'); |
|
665 | ||
666 | $repo = $this->em->getRepository(CmsUser::class); |
|
667 | $repo->findBy(['status' => 'test'], ['username' => 'INVALID']); |
|
668 | } |
|
669 | ||
670 | /** |
|
671 | * @group DDC-1713 |
|
@@ 953-960 (lines=8) @@ | ||
950 | /** |
|
951 | * @group DDC-3045 |
|
952 | */ |
|
953 | public function testFindByFieldInjectionPrevented() |
|
954 | { |
|
955 | $this->expectException(ORMException::class); |
|
956 | $this->expectExceptionMessage('Unrecognized field: '); |
|
957 | ||
958 | $repository = $this->em->getRepository(CmsUser::class); |
|
959 | $repository->findBy(['username = ?; DELETE FROM cms_users; SELECT 1 WHERE 1' => 'test']); |
|
960 | } |
|
961 | ||
962 | /** |
|
963 | * @group DDC-3045 |
|
@@ 965-972 (lines=8) @@ | ||
962 | /** |
|
963 | * @group DDC-3045 |
|
964 | */ |
|
965 | public function testFindOneByFieldInjectionPrevented() |
|
966 | { |
|
967 | $this->expectException(ORMException::class); |
|
968 | $this->expectExceptionMessage('Unrecognized field: '); |
|
969 | ||
970 | $repository = $this->em->getRepository(CmsUser::class); |
|
971 | $repository->findOneBy(['username = ?; DELETE FROM cms_users; SELECT 1 WHERE 1' => 'test']); |
|
972 | } |
|
973 | ||
974 | /** |
|
975 | * @group DDC-3045 |
|
@@ 994-1001 (lines=8) @@ | ||
991 | /** |
|
992 | * @group DDC-3045 |
|
993 | */ |
|
994 | public function testFindInjectionPrevented() |
|
995 | { |
|
996 | $this->expectException(ORMException::class); |
|
997 | $this->expectExceptionMessage('Unrecognized identifier fields: '); |
|
998 | ||
999 | $repository = $this->em->getRepository(CmsUser::class); |
|
1000 | $repository->find(['username = ?; DELETE FROM cms_users; SELECT 1 WHERE 1' => 'test', 'id' => 1]); |
|
1001 | } |
|
1002 | ||
1003 | /** |
|
1004 | * @group DDC-3056 |