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); } }
public function setUp() { parent::setUp(); if (!self::$tableCreated) { /* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */ $table = new \Doctrine\DBAL\Schema\Table("modify_limit_table"); $table->addColumn('test_int', 'integer'); $table->setPrimaryKey(array('test_int')); $table2 = new \Doctrine\DBAL\Schema\Table("modify_limit_table2"); $table2->addColumn('id', 'integer', array('autoincrement' => true)); $table2->addColumn('test_int', 'integer'); $table2->setPrimaryKey(array('id')); $sm = $this->_conn->getSchemaManager(); $sm->createTable($table); $sm->createTable($table2); self::$tableCreated = true; } }
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'); } }
public function setUp() { parent::setUp(); if (!$this->_conn->getSchemaManager()->tablesExist("ddc1372_foobar")) { try { $table = new \Doctrine\DBAL\Schema\Table("ddc1372_foobar"); $table->addColumn('id', 'integer'); $table->addColumn('foo', 'string'); $table->addColumn('bar', 'string'); $table->setPrimaryKey(array('id')); $sm = $this->_conn->getSchemaManager(); $sm->createTable($table); $this->_conn->insert('ddc1372_foobar', array('id' => 1, 'foo' => 1, 'bar' => 1)); $this->_conn->insert('ddc1372_foobar', array('id' => 2, 'foo' => 1, 'bar' => 2)); $this->_conn->insert('ddc1372_foobar', array('id' => 3, 'foo' => 1, 'bar' => 3)); $this->_conn->insert('ddc1372_foobar', array('id' => 4, 'foo' => 1, 'bar' => 4)); $this->_conn->insert('ddc1372_foobar', array('id' => 5, 'foo' => 2, 'bar' => 1)); $this->_conn->insert('ddc1372_foobar', array('id' => 6, 'foo' => 2, 'bar' => 2)); $this->refresh('ddc1372_foobar'); } catch (\Exception $e) { $this->fail($e->getMessage()); } } }
public function setUp() { $this->resetSharedConn(); parent::setUp(); }
public function setUp() { parent::setUp(); $this->_sm = $this->_conn->getSchemaManager(); }