/**
  * Sets up a Database Object for the test
  */
 public function setUp()
 {
     $generated = DBXmlGenerator::createFromTable($this->newTable('deviceinfo', ['deviceinfo_id' => [DB_ATTRTYPE_INT, 255], 'serial_number' => [DB_ATTRTYPE_INT, 16], 'text' => [DB_ATTRTYPE_TEXT, 255]]), 'localhost', 'FOOBAR');
     $this->xpath = new XPath($generated->getSource());
 }
 public function generateTableXml($tables, $constraints, $storage)
 {
     $xml = array();
     foreach ($tables as $table) {
         // Calculate classname
         $className = ucfirst($table->name);
         if (isset($this->prefix)) {
             switch (1) {
                 case false == $this->ptargets:
                 case in_array($table->name, $this->ptargets) && false == $this->pexclude:
                 case !in_array($table->name, $this->ptargets) && true == $this->pexclude:
                     $className = $this->prefix . $className;
                     break;
             }
         }
         $gen = DBXmlGenerator::createFromTable($table, $this->host, $this->adapter->conn->dsn->getDatabase())->getTree();
         // Add extra information
         with($node = $gen->root->children[0]);
         $node->setAttribute('dbtype', $this->adapter->conn->dsn->getDriver());
         $node->setAttribute('class', $className);
         $node->setAttribute('package', $this->package);
         $xml[] = $storage->write($className, $gen->getSource(INDENT_DEFAULT));
     }
     $storage->write(self::CONSTRAINT_FILE_NAME, $constraints->getSource(INDENT_DEFAULT));
     return $xml;
 }