| @@ 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 | * Ensure indexes are inherited from the mapped superclass. |
|
| @@ 213-226 (lines=14) @@ | ||
| 210 | ); |
|
| 211 | } |
|
| 212 | ||
| 213 | public function testEntityCustomGenerator() |
|
| 214 | { |
|
| 215 | $class = $this->createClassMetadata(Animal::class); |
|
| 216 | ||
| 217 | self::assertEquals(Mapping\GeneratorType::CUSTOM, $class->getProperty('id')->getValueGenerator()->getType(), "Generator Type"); |
|
| 218 | self::assertEquals( |
|
| 219 | [ |
|
| 220 | 'class' => 'stdClass', |
|
| 221 | 'arguments' => [], |
|
| 222 | ], |
|
| 223 | $class->getProperty('id')->getValueGenerator()->getDefinition(), |
|
| 224 | "Generator Definition" |
|
| 225 | ); |
|
| 226 | } |
|
| 227 | ||
| 228 | ||
| 229 | /** |
|