public function setUp() { $this->connection = DriverManager::getConnection(json_decode(DUMPLIE_TEST_DB_CONNECTION, true)); if ($this->connection->getSchemaManager()->tablesExist('metadata_test_bar')) { $this->connection->getSchemaManager()->dropTable('metadata_test_bar'); } if ($this->connection->getSchemaManager()->tablesExist('metadata_test_foo')) { $this->connection->getSchemaManager()->dropTable('metadata_test_foo'); } $foo = new TypeSchema('foo', ['id' => new TextField(), 'text' => new TextField(null, false, ['index' => true])]); $bar = new TypeSchema('bar', ['id' => new TextField(), 'link' => new AssociationField('test', $foo)]); $this->schema = new Schema('test'); $this->schema->add($foo); $this->schema->add($bar); $this->storage = new DoctrineStorage($this->connection, TypeRegistry::withDefaultTypes()); }
/** * @return Storage */ public function createStorage() : Storage { return new DoctrineStorage(self::createConnection(), TypeRegistry::withDefaultTypes()); }