From 43233000543984eda49768edde65076fb9c2468c Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Sun, 18 Nov 2012 20:26:25 +0000 Subject: dropped old tests referring to unexisting components (NOTE: this includes what seems a test suite for an older version of SQLMap) --- tests/unit/SQLMap/common.php | 152 ------------------------------------------- 1 file changed, 152 deletions(-) delete mode 100644 tests/unit/SQLMap/common.php (limited to 'tests/unit/SQLMap/common.php') diff --git a/tests/unit/SQLMap/common.php b/tests/unit/SQLMap/common.php deleted file mode 100644 index f13fe829..00000000 --- a/tests/unit/SQLMap/common.php +++ /dev/null @@ -1,152 +0,0 @@ - 0) - $connection->execute($line); - } - } -} - -class CopyFileScriptRunner -{ - protected $baseFile; - protected $targetFile; - - public function __construct($base, $target) - { - $this->baseFile = $base; - $this->targetFile = $target; - } - - function runScript($connection, $script) - { - copy($this->baseFile, $this->targetFile); - } -} - -class SQLiteBaseTestConfig extends BaseTestConfig -{ - protected $baseFile; - protected $targetFile; - - public function __construct() - { - $this->_sqlmap = SQLMAP_TESTS.'/sqlite.xml'; - $this->targetFile = realpath(SQLMAP_TESTS.'/sqlite/tests.db'); - $this->baseFile = realpath(SQLMAP_TESTS.'/sqlite/backup.db'); - $file = urlencode($this->targetFile); - $this->_connectionString = "sqlite://{$file}/"; - $this->_scriptDir = SQLMAP_TESTS.'/scripts/sqlite/'; - } - - public function getScriptRunner() - { - 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->_scriptDir = SQLMAP_TESTS.'/scripts/mysql/'; - $this->_features = array('insert_id'); - } -} - -class MSSQLBaseTestConfig extends BaseTestConfig -{ - public function __construct() - { - $this->_sqlmap = SQLMAP_TESTS.'/mssql.xml'; - $this->_connectionString = 'odbc_mssql://sqlmap_tests'; - $this->_scriptDir = SQLMAP_TESTS.'/scripts/mssql/'; - $this->_features = array('insert_id'); - } -} - -class BaseTestConfig -{ - protected $_scriptDir; - protected $_connectionString; - protected $_sqlmap; - protected $_features = array(); - - public function getScriptDir() { return $this->_scriptDir; } - public function getConnectionString() { return $this->_connectionString; } - public function getSqlMapConfigFile(){ return $this->_sqlmap; } - - public function hasFeature($feature) - { - return in_array($feature, $this->_features); - } - - public function getScriptRunner() - { - return new DefaultScriptRunner(); - } - - - public static function createConfigInstance() - { - //change this to connection to a different database - - //return new MySQLBaseTestConfig(); - - return new SQLiteBaseTestConfig(); - - //return new MSSQLBaseTestConfig(); - } - -} - - -?> \ No newline at end of file -- cgit v1.2.3