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


PHP Db::destroyDatabaseObject方法代码示例

本文整理汇总了PHP中Piwik\Db::destroyDatabaseObject方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::destroyDatabaseObject方法的具体用法?PHP Db::destroyDatabaseObject怎么用?PHP Db::destroyDatabaseObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik\Db的用法示例。


在下文中一共展示了Db::destroyDatabaseObject方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test_constructor_shouldNotEstablishADatabaseConnection

 public function test_constructor_shouldNotEstablishADatabaseConnection()
 {
     Db::destroyDatabaseObject();
     $this->assertNotDbConnectionCreated();
     $this->createSettingsInstance();
     $this->assertNotDbConnectionCreated();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:7,代码来源:SettingsTest.php

示例2: test_SqlMode_IsSet_PDO

 /**
  * @dataProvider getDbAdapter
  */
 public function test_SqlMode_IsSet_PDO($adapter, $expectedClass)
 {
     Db::destroyDatabaseObject();
     Config::getInstance()->database['adapter'] = $adapter;
     $db = Db::get();
     // make sure test is useful and setting adapter works
     $this->assertInstanceOf($expectedClass, $db);
     $result = $db->fetchOne('SELECT @@SESSION.sql_mode');
     $expected = 'NO_AUTO_VALUE_ON_ZERO,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER';
     $this->assertSame($expected, $result);
 }
开发者ID:normimuc,项目名称:piwik,代码行数:14,代码来源:DbTest.php

示例3: test_constructor_shouldEstablishADatabaseConnection_AsSoonAsWeSetAValue

 public function test_constructor_shouldEstablishADatabaseConnection_AsSoonAsWeSetAValue()
 {
     $this->setSuperUser();
     Db::destroyDatabaseObject();
     $setting = $this->buildUserSetting('testSetting', 'Test Setting');
     $settings = $this->createSettingsInstance();
     $settings->addSetting($setting);
     $this->assertNotDbConnectionCreated();
     $setting->setValue('5');
     $this->assertDbConnectionCreated();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:11,代码来源:UserSettingTest.php

示例4: test_getDbLock_shouldGetLock

 public function test_getDbLock_shouldGetLock()
 {
     $db = Db::get();
     $this->assertTrue(Db::getDbLock('MyLock'));
     // same session still has lock
     $this->assertTrue(Db::getDbLock('MyLock'));
     Db::setDatabaseObject(null);
     // different session, should not be able to acquire lock
     $this->assertFalse(Db::getDbLock('MyLock', 1));
     // different session cannot release lock
     $this->assertFalse(Db::releaseDbLock('MyLock'));
     Db::destroyDatabaseObject();
     // release lock again by using previous session
     Db::setDatabaseObject($db);
     $this->assertTrue(Db::releaseDbLock('MyLock'));
     Db::destroyDatabaseObject();
 }
开发者ID:dorelljames,项目名称:piwik,代码行数:17,代码来源:DbTest.php

示例5: test_process_ShouldNotCreateADatabaseConnectionAtAnyTime

 public function test_process_ShouldNotCreateADatabaseConnectionAtAnyTime()
 {
     $this->setDummyRequests(false);
     Queue\Factory::getSettings()->queueEnabled->getValue();
     // this will cause a db query but will be cached afterwards
     Db::destroyDatabaseObject();
     $this->handler->init($this->tracker, $this->requestSet);
     $this->assertNotDbConnectionCreated();
     $this->handler->onStartTrackRequests($this->tracker, $this->requestSet);
     $this->assertNotDbConnectionCreated();
     $this->handler->process($this->tracker, $this->requestSet);
     $this->assertNotDbConnectionCreated();
     $this->handler->onAllRequestsTracked($this->tracker, $this->requestSet);
     $this->assertNotDbConnectionCreated();
     $this->handler->finish($this->tracker, $this->requestSet);
     $this->assertNotDbConnectionCreated();
 }
开发者ID:ruchitrami,项目名称:plugin-QueuedTracking,代码行数:17,代码来源:HandlerTest.php

示例6: resetDatabase

 private function resetDatabase()
 {
     Option::clearCache();
     Db::destroyDatabaseObject();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:5,代码来源:RequestCommand.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     Db::destroyDatabaseObject();
     $this->settings = $this->createSettingsInstance();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:6,代码来源:IntegrationTestCase.php


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