当前位置: 首页>>代码示例>>PHP>>正文


PHP TestHelper::getDBManager方法代码示例

本文整理汇总了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);
 }
开发者ID:arcavias,项目名称:arcavias-core,代码行数:14,代码来源:MysqlTest.php

示例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();
 }
开发者ID:boettner-it,项目名称:aimeos-core,代码行数:14,代码来源:StandardTest.php

示例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);
 }
开发者ID:Bananamoon,项目名称:aimeos-core,代码行数:16,代码来源:DBTest.php

示例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);
 }
开发者ID:boettner-it,项目名称:aimeos-core,代码行数:16,代码来源:SQLTest.php

示例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);
 }
开发者ID:Bananamoon,项目名称:aimeos-core,代码行数:18,代码来源:AbstractTest.php

示例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);
 }
开发者ID:boettner-it,项目名称:aimeos-core,代码行数:18,代码来源:BaseTest.php

示例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);
    }
开发者ID:arcavias,项目名称:arcavias-core,代码行数:25,代码来源:DBTest.php

示例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());
 }
开发者ID:arcavias,项目名称:arcavias-core,代码行数:24,代码来源:SQLTest.php

示例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);
 }
开发者ID:Bananamoon,项目名称:aimeos-core,代码行数:11,代码来源:SQLTest.php

示例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);
 }
开发者ID:boettner-it,项目名称:aimeos-core,代码行数:14,代码来源:DBNestedSetTest.php

示例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);
 }
开发者ID:boettner-it,项目名称:aimeos-core,代码行数:6,代码来源:FactoryTest.php


注:本文中的TestHelper::getDBManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。