@@ 150-160 (lines=11) @@ | ||
147 | * @group DDC-1156 |
|
148 | * @group DDC-1218 |
|
149 | */ |
|
150 | public function testGeneratedValueFromMappedSuperclass() |
|
151 | { |
|
152 | /* @var ClassMetadata $class */ |
|
153 | $class = $this->cmf->getMetadataFor(SuperclassEntity::class); |
|
154 | ||
155 | self::assertSame(GeneratorType::SEQUENCE, $class->getProperty('id')->getValueGenerator()->getType()); |
|
156 | self::assertEquals( |
|
157 | ['allocationSize' => 1, 'sequenceName' => 'foo'], |
|
158 | $class->getProperty('id')->getValueGenerator()->getDefinition() |
|
159 | ); |
|
160 | } |
|
161 | ||
162 | /** |
|
163 | * @group DDC-1156 |
|
@@ 166-176 (lines=11) @@ | ||
163 | * @group DDC-1156 |
|
164 | * @group DDC-1218 |
|
165 | */ |
|
166 | public function testSequenceDefinitionInHierarchyWithSandwichMappedSuperclass() |
|
167 | { |
|
168 | /* @var ClassMetadata $class */ |
|
169 | $class = $this->cmf->getMetadataFor(HierarchyD::class); |
|
170 | ||
171 | self::assertSame(GeneratorType::SEQUENCE, $class->getProperty('id')->getValueGenerator()->getType()); |
|
172 | self::assertEquals( |
|
173 | ['allocationSize' => 1, 'sequenceName' => 'foo'], |
|
174 | $class->getProperty('id')->getValueGenerator()->getDefinition() |
|
175 | ); |
|
176 | } |
|
177 | ||
178 | /** |
|
179 | * @group DDC-1156 |
|
@@ 182-192 (lines=11) @@ | ||
179 | * @group DDC-1156 |
|
180 | * @group DDC-1218 |
|
181 | */ |
|
182 | public function testMultipleMappedSuperclasses() |
|
183 | { |
|
184 | /* @var ClassMetadata $class */ |
|
185 | $class = $this->cmf->getMetadataFor(MediumSuperclassEntity::class); |
|
186 | ||
187 | self::assertSame(GeneratorType::SEQUENCE, $class->getProperty('id')->getValueGenerator()->getType()); |
|
188 | self::assertEquals( |
|
189 | ['allocationSize' => 1, 'sequenceName' => 'foo'], |
|
190 | $class->getProperty('id')->getValueGenerator()->getDefinition() |
|
191 | ); |
|
192 | } |
|
193 | } |
|
194 | ||
195 | class TransientBaseClass { |
@@ 208-221 (lines=14) @@ | ||
205 | ); |
|
206 | } |
|
207 | ||
208 | public function testEntityCustomGenerator() |
|
209 | { |
|
210 | $class = $this->createClassMetadata(Animal::class); |
|
211 | ||
212 | self::assertEquals(Mapping\GeneratorType::CUSTOM, $class->getProperty('id')->getValueGenerator()->getType(), "Generator Type"); |
|
213 | self::assertEquals( |
|
214 | [ |
|
215 | 'class' => 'stdClass', |
|
216 | 'arguments' => [], |
|
217 | ], |
|
218 | $class->getProperty('id')->getValueGenerator()->getDefinition(), |
|
219 | "Generator Definition" |
|
220 | ); |
|
221 | } |
|
222 | ||
223 | ||
224 | /** |