| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | protected static function configureDb() |
||
| 34 | { |
||
| 35 | static::bootKernel(); |
||
| 36 | /** @var EntityManagerInterface $em */ |
||
| 37 | $em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager'); |
||
| 38 | |||
| 39 | $metadata = $em->getMetadataFactory()->getAllMetadata(); |
||
| 40 | $tool = new SchemaTool($em); |
||
| 41 | $tool->dropDatabase(); |
||
| 42 | $tool->createSchema($metadata); |
||
| 43 | $validator = new SchemaValidator($em); |
||
| 44 | $errors = $validator->validateMapping(); |
||
| 45 | static::assertCount( |
||
| 46 | 0, |
||
| 47 | $errors, |
||
| 48 | implode( |
||
| 49 | "\n\n", |
||
| 50 | array_map( |
||
| 51 | function ($l) { |
||
| 52 | return implode("\n\n", $l); |
||
| 53 | }, |
||
| 54 | $errors |
||
| 55 | ) |
||
| 56 | ) |
||
| 57 | ); |
||
| 58 | } |
||
| 59 | |||
| 65 |