本文整理汇总了PHP中TestHelper::getDBManager方法的典型用法代码示例。如果您正苦于以下问题:PHP TestHelper::getDBManager方法的具体用法?PHP TestHelper::getDBManager怎么用?PHP TestHelper::getDBManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestHelper
的用法示例。
在下文中一共展示了TestHelper::getDBManager方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
$this->_dbm = TestHelper::getDBManager();
$conn = $this->_dbm->acquire();
$conn->create('DROP INDEX "idx_msdt_smallint" ON "mw_setup_dbschema_test"')->execute()->finish();
$conn->create('DROP TABLE "mw_setup_dbschema_test"')->execute()->finish();
$this->_dbm->release($conn);
}
示例2: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$this->config = \TestHelper::getConfig();
if ($this->config->get('resource/db/adapter', false) === false) {
$this->markTestSkipped('No database configured');
}
$this->dbm = \TestHelper::getDBManager();
}
示例3: tearDown
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
if (TestHelper::getConfig()->get('resource/db/adapter', false) === false) {
return;
}
$this->_dbm = TestHelper::getDBManager();
$conn = $this->_dbm->acquire();
$conn->create('DROP TABLE "mw_log_test"')->execute()->finish();
$this->_dbm->release($conn);
}
示例4: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
if (\TestHelper::getConfig()->get('resource/db/adapter', false) === false) {
$this->markTestSkipped('No database configured');
}
$dbm = \TestHelper::getDBManager();
$conn = $dbm->acquire();
$this->object = new \Aimeos\MW\Criteria\SQL($conn);
$dbm->release($conn);
}
示例5: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$config = TestHelper::getConfig();
if ($config->get('resource/db/adapter', false) === false) {
$this->markTestSkipped('No database configured');
}
$dbm = TestHelper::getDBManager();
$conn = $dbm->acquire();
$schema = new MW_Setup_DBSchema_Mysql($conn, $config->get('resource/db/database', 'notfound'));
$this->_object = new MW_Setup_Task_AbstractImpl($schema, $conn);
$dbm->release($conn);
}
示例6: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
$config = \TestHelper::getConfig();
if ($config->get('resource/db/adapter', false) === false) {
$this->markTestSkipped('No database configured');
}
$dbm = \TestHelper::getDBManager();
$conn = $dbm->acquire();
$schema = new \Aimeos\MW\Setup\DBSchema\Mysql($conn, $config->get('resource/db/database', 'notfound'));
$this->object = new BaseImpl($schema, $conn);
$dbm->release($conn);
}
示例7: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @access protected
*/
protected function setUp()
{
if (TestHelper::getConfig()->get('resource/db/adapter', false) === false) {
$this->markTestSkipped('No database configured');
}
$this->_dbm = TestHelper::getDBManager();
$conn = $this->_dbm->acquire();
$conn->create('
CREATE TABLE IF NOT EXISTS "mw_log_test" (
"facility" VARCHAR(32) NOT NULL,
"request" VARCHAR(32) NOT NULL,
"tstamp" VARCHAR(20) NOT NULL,
"priority" INTEGER NOT NULL,
"message" TEXT NOT NULL
);')->execute()->finish();
$sql = 'INSERT INTO "mw_log_test" ( "facility", "tstamp", "priority", "message", "request" ) VALUES ( ?, ?, ?, ?, ? )';
$this->_object = new MW_Logger_DB($conn->create($sql));
$this->_dbm->release($conn);
}
示例8: testToString
public function testToString()
{
$dbm = TestHelper::getDBManager();
$conn = $dbm->acquire();
$dbm->release($conn);
$types = array('list' => MW_DB_Statement_Abstract::PARAM_STR, 'string' => MW_DB_Statement_Abstract::PARAM_STR, 'float' => MW_DB_Statement_Abstract::PARAM_FLOAT, 'int' => MW_DB_Statement_Abstract::PARAM_INT, 'undefined' => MW_DB_Statement_Abstract::PARAM_INT, 'bool' => MW_DB_Statement_Abstract::PARAM_BOOL);
$expr1 = array();
$expr1[] = new MW_Common_Criteria_Expression_Compare_SQL($conn, '==', 'list', array('a', 'b', 'c'));
$expr1[] = new MW_Common_Criteria_Expression_Compare_SQL($conn, '~=', 'string', 'value');
$expr2 = array();
$expr2[] = new MW_Common_Criteria_Expression_Compare_SQL($conn, '<', 'float', 0.1);
$expr2[] = new MW_Common_Criteria_Expression_Compare_SQL($conn, '>', 'int', 10);
$objects = array();
$objects[] = new MW_Common_Criteria_Expression_Combine_SQL('&&', $expr1);
$objects[] = new MW_Common_Criteria_Expression_Combine_SQL('&&', $expr2);
$object = new MW_Common_Criteria_Expression_Combine_SQL('||', $objects);
$test = new MW_Common_Criteria_Expression_Combine_SQL('!', array($object));
$expected = " NOT ( ( list IN ('a','b','c') AND string LIKE '%value%' ) OR ( float < 0.1 AND int > 10 ) )";
$this->assertEquals($expected, $test->toString($types));
$obj = new MW_Common_Criteria_Expression_Combine_SQL('&&', array());
$this->assertEquals('', $obj->toString($types));
$this->setExpectedException('MW_Common_Exception');
new MW_Common_Criteria_Expression_Combine_SQL('', array());
}
示例9: tearDown
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
$dbm = TestHelper::getDBManager();
$dbm->release($this->_conn);
}
示例10: tearDown
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown()
{
$sql = 'DROP TABLE "mw_tree_test"';
$this->dbm = \TestHelper::getDBManager();
$conn = $this->dbm->acquire();
$conn->create($sql)->execute()->finish();
$this->dbm->release($conn);
}
示例11: testFactory
public function testFactory()
{
$config = array('sql' => array('delete' => '', 'deletebytag' => '', 'get' => '', 'getbytag' => '', 'set' => '', 'settag' => ''), 'search' => array('cache.id' => '', 'cache.siteid' => '', 'cache.value' => '', 'cache.expire' => '', 'cache.tag.name' => ''));
$object = \Aimeos\MW\Cache\Factory::createManager('DB', $config, \TestHelper::getDBManager());
$this->assertInstanceOf('\\Aimeos\\MW\\Cache\\Iface', $object);
}