protected function getMysqlSqlMapManager() { static $conn; static $sqlMapManager; if (Prado::getApplication() === null) { Prado::setApplication(new TApplication(dirname(__FILE__) . '/app')); } if ($conn === null) { $conn = new TDbConnection('mysql:host=localhost;dbname=prado_system_data_sqlmap', 'prado_unitest', 'prado_system_data_sqlmap_unitest'); } $conn->setActive(true); if ($sqlMapManager === null) { $sqlMapManager = new TSqlMapManager($conn); $sqlMapManager->configureXml(dirname(__FILE__) . '/DynamicParameterTestMap.xml'); } return $sqlMapManager; }
/** * Constructor. * @param TDbConnection the database connection * @param string the SQL statement to be executed * @param TDbStatementClassification Defaults to 'UNKNOWN' */ public function __construct(TDbConnection $connection, $text, $classification = TDbStatementClassification::UNKNOWN) { $connection->setActive(true); parent::__construct($connection, $text); $this->_statementClassification = $classification; Prado::log($classification . ', ' . $connection->getServerRole() . ': ' . preg_replace('/[\\s]+/', ' ', $text), TLogger::DEBUG, 'System.Testing.Data.Distributed.TDistributedDbCommand'); }