當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ConnectionManager::drop方法代碼示例

本文整理匯總了PHP中ConnectionManager::drop方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConnectionManager::drop方法的具體用法?PHP ConnectionManager::drop怎麽用?PHP ConnectionManager::drop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ConnectionManager的用法示例。


在下文中一共展示了ConnectionManager::drop方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: tearDown

 function tearDown()
 {
     ConnectionManager::drop('testapi');
     ConnectionManager::drop('testapiToken');
     Configure::delete('Copula.testapi.Auth');
     unset($this->controller, $this->Oauth);
     parent::tearDown();
 }
開發者ID:mohitkochhar,項目名稱:Copula,代碼行數:8,代碼來源:OauthComponentTest.php

示例2: tearDown

 function tearDown()
 {
     parent::tearDown();
     Cache::clear(false, 'default');
     ConnectionManager::drop('cacher');
     unset($this->CacheData);
     unset($this->dataSource);
 }
開發者ID:jeremyharris,項目名稱:cacher,代碼行數:8,代碼來源:CacheSourceTest.php

示例3: tearDown

 public function tearDown()
 {
     $manager = ConnectionManager::getDataSource('testMongoFixture')->getSchemaManager();
     $manager->dropDocumentCollection('User');
     $manager->dropDocumentCollection('Account');
     App::build();
     ClassRegistry::flush();
     ConnectionManager::drop('testMongoFixture');
 }
開發者ID:beyondkeysystem,項目名稱:MongoCake,代碼行數:9,代碼來源:DocumentTestFixtureTest.php

示例4: testGetTokenRefresh

 public function testGetTokenRefresh()
 {
     $config = array('datasource' => 'Copula.RemoteTokenSource', 'login' => 'login', 'password' => 'password', 'authMethod' => 'OAuthV2', 'access' => 'token', 'scheme' => 'https', 'host' => 'accounts.example.com');
     ConnectionManager::create('testapiToken', $config);
     $testapi = ConnectionManager::getDataSource('testapiToken');
     $testapi->Http = $this->getMock('HttpSocketOauth');
     $refresh = new HttpSocketResponse();
     $refresh->code = 200;
     $body = array('access_token' => 'token', 'refresh_token' => 'refresh', 'expires_in' => '1234');
     $refresh->body = json_encode($body);
     $refresh->headers['Content-Type'] = 'application/json';
     $request = array('method' => 'POST', 'uri' => array('host' => 'accounts.example.com', 'path' => 'token', 'scheme' => 'https'), 'body' => array('client_id' => 'login', 'client_secret' => 'password', 'grant_type' => 'refresh_token', 'refresh_token' => 'canHasRefresh'));
     $testapi->Http->expects($this->once())->method('request')->will($this->returnValueMap(array(array($request, $refresh))));
     $token = $this->tokenV2;
     $token['modified'] = '1970-01-01 00:00:00';
     CakeSession::write('Copula.testapi.42', $token);
     $result = $this->Token->getToken('42', 'testapi');
     $expected = array_merge($token, $body);
     $this->assertEquals($expected, $result);
     ConnectionManager::drop('testapiToken');
 }
開發者ID:mohitkochhar,項目名稱:Copula,代碼行數:21,代碼來源:TokenStoreSessionTest.php

示例5: testModelPrefixFromDatasource

 /**
  * Tests that tablePrefix is taken from the datasource if none is defined in the model
  *
  * @return void
  * @see http://cakephp.lighthouseapp.com/projects/42648/tickets/2277-caketestmodels-in-test-cases-do-not-set-model-tableprefix
  */
 public function testModelPrefixFromDatasource()
 {
     ConnectionManager::create('mock', array('datasource' => 'DboMock', 'prefix' => 'custom_prefix_'));
     $Article = new Article(false, null, 'mock');
     $this->assertEquals('custom_prefix_', $Article->tablePrefix);
     ConnectionManager::drop('mock');
 }
開發者ID:ronaldsalazar23,項目名稱:ComercialChiriguano,代碼行數:13,代碼來源:ModelIntegrationTest.php

示例6: testGetMockForModelSecondaryDatasource

 /**
  * Test getMockForModel on secondary datasources.
  *
  * @return void
  */
 public function testGetMockForModelSecondaryDatasource()
 {
     App::build(array('Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), 'Model/Datasource/Database' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS . 'Database' . DS)), App::RESET);
     CakePlugin::load('TestPlugin');
     ConnectionManager::create('test_secondary', array('datasource' => 'Database/TestLocalDriver'));
     $post = $this->getMockForModel('SecondaryPost', array('save'));
     $this->assertEquals('test_secondary', $post->useDbConfig);
     ConnectionManager::drop('test_secondary');
 }
開發者ID:keetamhoang,項目名稱:lotdephong,代碼行數:14,代碼來源:CakeTestCaseTest.php

示例7: tearDown

 public function tearDown()
 {
     ConnectionManager::drop('testapi');
     unset($this->components, $this->auth, $this->request);
     parent::tearDown();
 }
開發者ID:mohitkochhar,項目名稱:Copula,代碼行數:6,代碼來源:OauthAuthorizeTest.php

示例8: testDrop

 /**
  * Tests that a connection configuration can be deleted in runtime
  *
  * @return void
  */
 public function testDrop()
 {
     App::build(array('Model/Datasource' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS)));
     ConnectionManager::create('droppable', array('datasource' => 'Test2Source'));
     $connections = ConnectionManager::enumConnectionObjects();
     $this->assertEquals(array('datasource' => 'Test2Source'), $connections['droppable']);
     $this->assertTrue(ConnectionManager::drop('droppable'));
     $connections = ConnectionManager::enumConnectionObjects();
     $this->assertFalse(isset($connections['droppable']));
 }
開發者ID:Oswald-Dsa,項目名稱:cakephp-ex,代碼行數:15,代碼來源:ConnectionManagerTest.php

示例9: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     ConnectionManager::drop('test_twitter_app');
     ConnectionManager::drop('test_twitter2');
     parent::tearDownAfterClass();
 }
開發者ID:nojimage,項目名稱:cakephp-twim,代碼行數:6,代碼來源:TwimAppModelTest.php

示例10: tearDownAfterClass

 static function tearDownAfterClass()
 {
     ConnectionManager::drop('test_twitter_component');
     ConnectionManager::drop('fake_twitter');
 }
開發者ID:nojimage,項目名稱:cakephp-twim,代碼行數:5,代碼來源:TwitterComponentTest.php

示例11: tearDown

 public function tearDown()
 {
     ConnectionManager::drop('testapi');
     unset($this->Source, $this->Model);
     parent::tearDown();
 }
開發者ID:mohitkochhar,項目名稱:Copula,代碼行數:6,代碼來源:RemoteTokenSourceTest.php

示例12: __testDbConnection

    /**
     * Test the two db connections 'default', and 'test' using the passed db config params
     *
     * @access private
     * @param array $dbConfig
     * @param array $connectionName name of the database we are trying to connect to
     * @return array
     */
    private function __testDbConnection($dbConfig, $connectionName)
    {
        $connected = false;

        try {
            $this->out("Trying '{$connectionName}' database connection");
            ConnectionManager::create($connectionName, $dbConfig);

            $this->out("++ Successfully connected to database using entered connection parameters");
            $connected = true;
        } catch(MissingConnectionException $ex) {
            ConnectionManager::drop($connectionName);
            $this->out("** ERROR ** '" . ucfirst($connectionName) . "' database connection parameters failed");
        }

        return $connected;
    }
開發者ID:42northgroup,項目名稱:42Viral,代碼行數:25,代碼來源:SetupShell.php

示例13: tearDown

 public function tearDown()
 {
     parent::tearDown();
     ConnectionManager::drop($this->testDatasourceName);
     ConnectionManager::drop($this->mockDatasourceName);
 }
開發者ID:nojimage,項目名稱:cakephp-twim,代碼行數:6,代碼來源:TwimConnectionTestCase.php

示例14: tearDown

 public function tearDown()
 {
     ConnectionManager::drop('testapi');
     unset($this->model, $this->Apis);
     ClassRegistry::flush();
     parent::tearDown();
 }
開發者ID:mohitkochhar,項目名稱:Copula,代碼行數:7,代碼來源:ApisSourceTest.php

示例15: testSchemaReadWithAppModel

 /**
  * testSchemaReadWithAppModel method
  *
  * @return void
  */
 public function testSchemaReadWithAppModel()
 {
     $connections = ConnectionManager::enumConnectionObjects();
     ConnectionManager::drop('default');
     ConnectionManager::create('default', $connections['test']);
     try {
         $this->Schema->read(array('connection' => 'default', 'name' => 'TestApp', 'models' => array('AppModel')));
     } catch (MissingTableException $mte) {
         ConnectionManager::drop('default');
         $this->fail($mte->getMessage());
     }
     ConnectionManager::drop('default');
 }
開發者ID:jgera,項目名稱:orangescrum,代碼行數:18,代碼來源:CakeSchemaTest.php


注:本文中的ConnectionManager::drop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。