| @@ 982-997 (lines=16) @@ | ||
| 979 | /** |
|
| 980 | * @group DDC-1663 |
|
| 981 | */ |
|
| 982 | public function testExistanceOfNamedNativeQuery() |
|
| 983 | { |
|
| 984 | $cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext); |
|
| 985 | $cm->initializeReflection(new RuntimeReflectionService()); |
|
| 986 | ||
| 987 | $cm->addNamedNativeQuery( |
|
| 988 | 'find-all', |
|
| 989 | 'SELECT * FROM cms_users', |
|
| 990 | [ |
|
| 991 | 'resultClass' => CMS\CmsUser::class, |
|
| 992 | ] |
|
| 993 | ); |
|
| 994 | ||
| 995 | self::assertTrue($cm->hasNamedNativeQuery('find-all')); |
|
| 996 | self::assertFalse($cm->hasNamedNativeQuery('find-by-id')); |
|
| 997 | } |
|
| 998 | ||
| 999 | public function testRetrieveOfNamedQuery() |
|
| 1000 | { |
|
| @@ 1017-1033 (lines=17) @@ | ||
| 1014 | /** |
|
| 1015 | * @group DDC-1663 |
|
| 1016 | */ |
|
| 1017 | public function testRetrievalOfNamedNativeQueries() |
|
| 1018 | { |
|
| 1019 | $cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext); |
|
| 1020 | $cm->initializeReflection(new RuntimeReflectionService()); |
|
| 1021 | ||
| 1022 | self::assertEquals(0, count($cm->getNamedNativeQueries())); |
|
| 1023 | ||
| 1024 | $cm->addNamedNativeQuery( |
|
| 1025 | 'find-all', |
|
| 1026 | 'SELECT * FROM cms_users', |
|
| 1027 | [ |
|
| 1028 | 'resultClass' => CMS\CmsUser::class, |
|
| 1029 | ] |
|
| 1030 | ); |
|
| 1031 | ||
| 1032 | self::assertEquals(1, count($cm->getNamedNativeQueries())); |
|
| 1033 | } |
|
| 1034 | ||
| 1035 | /** |
|
| 1036 | * @group DDC-2451 |
|