summaryrefslogtreecommitdiff
path: root/tests/simple_unit/SqlMap/common.php
diff options
context:
space:
mode:
authorwei <>2006-12-20 03:15:04 +0000
committerwei <>2006-12-20 03:15:04 +0000
commit2c221ea67d0512961beea8fbcb30b23865c16bb0 (patch)
treeaba7901f8e286d0b4101fc9022247897881bd5c1 /tests/simple_unit/SqlMap/common.php
parent2570226fbac3e26b1e94896b50d1db4bc1aa3308 (diff)
Add quickstart docs for Active Record and SqlMap
Diffstat (limited to 'tests/simple_unit/SqlMap/common.php')
-rw-r--r--tests/simple_unit/SqlMap/common.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/simple_unit/SqlMap/common.php b/tests/simple_unit/SqlMap/common.php
index 57685c31..aed11671 100644
--- a/tests/simple_unit/SqlMap/common.php
+++ b/tests/simple_unit/SqlMap/common.php
@@ -41,7 +41,7 @@ class DefaultScriptRunner
{
$line = trim($line);
if(strlen($line) > 0)
- $connection->execute($line);
+ $connection->createCommand($line)->execute();
}
}
}
@@ -84,15 +84,16 @@ class SQLiteBaseTestConfig extends BaseTestConfig
return new CopyFileScriptRunner($this->baseFile, $this->targetFile);
}
}
-/*
+
class MySQLBaseTestConfig extends BaseTestConfig
{
public function __construct()
{
- $this->_sqlmap = SQLMAP_TESTS.'/mysql.xml';
- $this->_connectionString = 'mysql://root:weizhuo01@localhost/IBatisNet';
+ $this->_sqlmapConfigFile = SQLMAP_TESTS.'/mysql.xml';
$this->_scriptDir = SQLMAP_TESTS.'/scripts/mysql/';
$this->_features = array('insert_id');
+ $dsn = 'mysql:host=localhost;dbname=sqlmap_test';
+ $this->_connection = new TDbConnection($dsn, 'test', 'test111');
}
}
@@ -106,7 +107,6 @@ class MSSQLBaseTestConfig extends BaseTestConfig
$this->_features = array('insert_id');
}
}
-*/
class BaseTestConfig
{
@@ -143,9 +143,9 @@ class BaseTestConfig
{
//change this to connection to a different database
- //return new MySQLBaseTestConfig();
+ return new MySQLBaseTestConfig();
- return new SQLiteBaseTestConfig();
+ //return new SQLiteBaseTestConfig();
//return new MSSQLBaseTestConfig();
}