예제 #1
0
 public function tearDown()
 {
     parent::tearDown();
     if ($this->_conn->getSchemaManager()->tablesExist("ddc1372_foobar")) {
         try {
             $sm = $this->_conn->getSchemaManager();
             $sm->dropTable('ddc1372_foobar');
         } catch (\Exception $e) {
             $this->fail($e->getMessage());
         }
     }
 }
예제 #2
0
 public function tearDown()
 {
     parent::tearDown();
     if (self::$tableCreated) {
         $sm = $this->_conn->getSchemaManager();
         try {
             $sm->dropTable('modify_limit_table');
             $sm->dropTable('modify_limit_table2');
             self::$tableCreated = false;
         } catch (DBALException $e) {
         }
     }
 }
예제 #3
0
 public function setUp()
 {
     parent::setUp();
     if (self::$generated === false) {
         self::$generated = true;
         /* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */
         $table = new \Doctrine\DBAL\Schema\Table("write_table");
         $table->addColumn('test_int', 'integer');
         $table->addColumn('test_string', 'string');
         $table->addColumn('test_float', 'float');
         $table->addColumn('test_array', 'array', array('columnDefinition' => 'ARRAY(STRING)'));
         $platformOptions = array('type' => MapType::STRICT, 'fields' => array(new Column('id', Type::getType('integer'), array()), new Column('name', Type::getType('string'), array()), new Column('value', Type::getType('float'), array())));
         $table->addColumn('test_obj', MapType::NAME, array('platformOptions' => $platformOptions));
         $sm = $this->_conn->getSchemaManager();
         $sm->createTable($table);
     }
 }
예제 #4
0
 public function setUp()
 {
     parent::setUp();
     if (self::$generated === false) {
         self::$generated = true;
         /* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */
         $sm = $this->_conn->getSchemaManager();
         $table = new \Doctrine\DBAL\Schema\Table("fetch_table");
         $table->addColumn('test_int', 'integer');
         $table->addColumn('test_string', 'string');
         $table->addColumn('test_datetime', 'timestamp', array('notnull' => false));
         $table->addColumn('test_array', 'array', array('columnDefinition' => 'ARRAY(STRING)'));
         $platformOptions = array('type' => MapType::STRICT, 'fields' => array(new Column('id', Type::getType('integer'), array()), new Column('name', Type::getType('string'), array()), new Column('value', Type::getType('float'), array())));
         $table->addColumn('test_object', MapType::NAME, array('platformOptions' => $platformOptions));
         $table->setPrimaryKey(array('test_int'));
         $sm->createTable($table);
         $this->_conn->insert('fetch_table', array('test_int' => 1, 'test_string' => 'foo', 'test_datetime' => new \DateTime('2010-01-01 10:10:10'), 'test_array' => array('foo', 'bar'), 'test_object' => array('id' => 1, 'name' => 'foo', 'value' => 1.234)), array('integer', 'string', 'timestamp', 'array', 'map'));
         $this->refresh('fetch_table');
     }
 }
예제 #5
0
 public function tearDown()
 {
     parent::tearDown();
     $this->resetSharedConn();
 }
예제 #6
0
 public function setUp()
 {
     parent::setUp();
     $this->_sm = $this->_conn->getSchemaManager();
 }