/**
  * Set up test environment.
  */
 public function setUp()
 {
     parent::setUp();
     $this->pool = new Pool($this->connection);
     $this->position_context_structure = new PositionContextStructure();
     if (!class_exists($this->head_type_class_name, false) && !class_exists($this->tail_type_class_name, false)) {
         $this->position_context_structure->build(null, $this->connection);
     }
     if ($this->connection->tableExists('position_context_head_entries')) {
         $this->connection->dropTable('position_context_head_entries');
     }
     if ($this->connection->tableExists('position_context_tail_entries')) {
         $this->connection->dropTable('position_context_tail_entries');
     }
     $type_table_builder = new TypeTableBuilder($this->position_context_structure);
     $type_table_builder->setConnection($this->connection);
     $type_table_builder->buildType($this->position_context_structure->getType('position_context_head_entries'));
     $type_table_builder->buildType($this->position_context_structure->getType('position_context_tail_entries'));
     $this->assertTrue($this->connection->tableExists('position_context_head_entries'));
     $this->assertTrue($this->connection->tableExists('position_context_tail_entries'));
     $this->pool->registerType($this->head_type_class_name);
     $this->pool->registerType($this->tail_type_class_name);
     $this->assertTrue($this->pool->isTypeRegistered($this->head_type_class_name));
     $this->assertTrue($this->pool->isTypeRegistered($this->tail_type_class_name));
 }
 /**
  * Set up test environment.
  */
 public function setUp()
 {
     parent::setUp();
     $this->pool = new Pool($this->connection);
     $this->json_serialization_structure = new JsonSerializationStructure();
     if (!class_exists($this->type_class_name, false)) {
         $this->json_serialization_structure->build(null, $this->connection);
     }
     if ($this->connection->tableExists('key_values')) {
         $this->connection->dropTable('key_values');
     }
     $type_table_builder = new TypeTableBuilder($this->json_serialization_structure);
     $type_table_builder->setConnection($this->connection);
     $type_table_builder->buildType($this->json_serialization_structure->getType('key_values'));
     $this->assertTrue($this->connection->tableExists('key_values'));
     $this->pool->registerType($this->type_class_name);
     $this->assertTrue($this->pool->isTypeRegistered($this->type_class_name));
 }