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


PHP Connections::reset方法代码示例

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


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

示例1: tearDown

 public function tearDown()
 {
     unset($this->query);
     Connections::reset();
     $this->db->dropDB('lithium_test');
     Connections::config($this->_configs);
 }
开发者ID:EHER,项目名称:chegamos,代码行数:7,代码来源:MongoDbTest.php

示例2: tearDown

 /**
  * Teardown method run after every test method.
  */
 public function tearDown()
 {
     Connections::reset();
     foreach ($this->_backup as $name => $config) {
         Connections::add($name, $config);
     }
 }
开发者ID:nashadalam,项目名称:lithium,代码行数:10,代码来源:CollectionTest.php

示例3: testConnectionGetAndReset

 public function testConnectionGetAndReset()
 {
     Connections::add('conn-test', $this->config);
     Connections::add('conn-test-2', $this->config);
     $this->assertEqual(array('conn-test', 'conn-test-2'), Connections::get());
     $expected = $this->config + array('type' => 'database', 'filters' => array());
     $this->assertEqual($expected, Connections::get('conn-test', array('config' => true)));
     $this->assertNull(Connections::reset());
     $this->assertFalse(Connections::get());
     Connections::__init();
     $this->assertTrue(is_array(Connections::get()));
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:12,代码来源:ConnectionsTest.php

示例4: setUp

 public function setUp()
 {
     if (empty($this->_backup)) {
         foreach (Connections::get() as $conn) {
             $this->_backup[$conn] = Connections::get($conn, array('config' => true));
         }
     }
     Connections::reset();
     Connections::add('mongo', array('type' => 'MongoDb', 'autoConnect' => false));
     Connections::add('couch', array('type' => 'http', 'adapter' => 'CouchDb'));
     MockDocumentPost::config(array('connection' => 'mongo'));
     MockDocumentMultipleKey::config(array('connection' => 'couch'));
 }
开发者ID:ncud,项目名称:sagalaya,代码行数:13,代码来源:DocumentSetTest.php

示例5: testConnectionGetAndReset

 public function testConnectionGetAndReset()
 {
     Connections::add('conn-test', $this->config);
     Connections::add('conn-test-2', $this->config);
     $this->assertEqual(array('conn-test', 'conn-test-2'), Connections::get());
     $message = 'Your PHP was not compiled with the MySQL extension';
     $this->skipIf(!extension_loaded('mysql'), $message);
     $expected = $this->config + array('type' => 'database', 'filters' => array());
     $this->assertEqual($expected, Connections::get('conn-test', array('config' => true)));
     $this->assertNull(Connections::reset());
     $this->assertFalse(Connections::get());
     $this->assertTrue(is_array(Connections::get()));
 }
开发者ID:EHER,项目名称:chegamos,代码行数:13,代码来源:ConnectionsTest.php

示例6: run

 /**
  * This hack is a necessary optimization until these tests are properly mocked out.
  *
  * @param array $options Options for the parent class' method.
  */
 public function run(array $options = array())
 {
     $this->_results = array();
     try {
         $this->skip();
     } catch (Exception $e) {
         $this->_handleException($e);
         return $this->_results;
     }
     $this->_configs = Connections::config();
     $result = parent::run($options);
     Connections::get('lithium_mongo_test')->dropDB('lithium_test');
     Connections::reset();
     Connections::config($this->_configs);
     return $result;
 }
开发者ID:rmarscher,项目名称:lithium,代码行数:21,代码来源:MongoDbTest.php

示例7: testGetNullAdapter

 public function testGetNullAdapter()
 {
     Connections::reset();
     $this->assertTrue(Connections::get(false) instanceof Mock);
 }
开发者ID:davidpersson,项目名称:FrameworkBenchmarks,代码行数:5,代码来源:ConnectionsTest.php

示例8: testGetNullAdapter

 public function testGetNullAdapter()
 {
     Connections::reset();
     $this->assertInstanceOf('lithium\\data\\source\\Mock', Connections::get(false));
 }
开发者ID:fedeisas,项目名称:lithium,代码行数:5,代码来源:ConnectionsTest.php

示例9: tearDown

 public function tearDown()
 {
     Connections::reset();
     Connections::config($this->_configs);
 }
开发者ID:rmarscher,项目名称:lithium,代码行数:5,代码来源:DatabaseTest.php

示例10: tearDown

 public function tearDown()
 {
     Connections::reset();
     Connections::config($this->_backup['connections']);
 }
开发者ID:radify,项目名称:li3_freshbooks,代码行数:5,代码来源:InvoicesTest.php


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