client = static::createClient(); $this->manager = static::getContainer()->get('doctrine')->getManager(); $schemaTool = new SchemaTool($this->manager); $metadata = $this->manager->getMetadataFactory() ->getAllMetadata(); $schemaTool->dropDatabase(); $schemaTool->updateSchema($metadata); if ($this->getEntityClass() !== '') { $this->repository = $this->manager->getRepository($this->getEntityClass()); } } }