當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。