/** * Can not use setUp() because we are using a dataProvider to get multiple * MDB2 objects per test. * * @param array $ci an associative array with two elements. The "dsn" * element must contain an array of DSN information. * The "options" element must be an array of connection * options. */ protected function manualSetUp($ci) { parent::manualSetUp($ci); $this->nonstd = Nonstandard_Base::factory($this->db, $this); $this->db->loadModule('Manager', null, true); $this->fields = array('id' => array('type' => 'integer', 'unsigned' => true, 'notnull' => true, 'default' => 0), 'somename' => array('type' => 'text', 'length' => 12), 'somedescription' => array('type' => 'text', 'length' => 12), 'sex' => array('type' => 'text', 'length' => 1, 'default' => 'M')); $options = array(); if ('mysql' == substr($this->db->phptype, 0, 5)) { $options['type'] = 'innodb'; } if (!$this->tableExists($this->table)) { $result = $this->db->manager->createTable($this->table, $this->fields, $options); $this->checkResultForErrors($result, 'createTable'); } }
/** * Can not use setUp() because we are using a dataProvider to get multiple * MDB2 objects per test. * * @param array $ci an associative array with two elements. The "dsn" * element must contain an array of DSN information. * The "options" element must be an array of connection * options. */ protected function manualSetUp($ci) { parent::manualSetUp($ci); $this->nonstd = Nonstandard_Base::factory($this->db, $this); $this->db->loadModule('Reverse', null, true); $this->db->loadModule('Manager', null, true); //Table structure $this->fields = array('id' => array('type' => 'integer', 'unsigned' => 1, 'notnull' => 1, 'default' => 0, 'length' => 4), 'id2' => array('type' => 'integer', 'unsigned' => 1, 'notnull' => 1, 'default' => 0), 'id3' => array('type' => 'integer', 'unsigned' => 1, 'notnull' => 1, 'default' => 0), 'id4' => array('type' => 'integer', 'unsigned' => 1, 'notnull' => 1, 'default' => 0), 'somename' => array('type' => 'text', 'length' => 12), 'somedescription' => array('type' => 'text', 'length' => 12), 'sex' => array('type' => 'text', 'length' => 1, 'default' => 'M')); $options = array(); if ('mysql' == substr($this->db->phptype, 0, 5)) { $options['type'] = 'innodb'; } if (!$this->tableExists($this->table)) { $this->db->manager->createTable($this->table, $this->fields, $options); } //Table2 structure $this->fields2 = array('ext_id' => array('type' => 'integer', 'unsigned' => 1, 'notnull' => 1, 'default' => 0), 'ext_id2' => array('type' => 'integer', 'unsigned' => 1, 'notnull' => 1, 'default' => 0), 'ext_id3' => array('type' => 'integer', 'unsigned' => 1, 'notnull' => 1, 'default' => 0)); if (!$this->tableExists($this->table2)) { $this->db->manager->createTable($this->table2, $this->fields2, $options); } }