当前位置: 首页>>代码示例>>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;未经允许,请勿转载。