本文整理汇总了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);
}
示例2: tearDown
/**
* Teardown method run after every test method.
*/
public function tearDown()
{
Connections::reset();
foreach ($this->_backup as $name => $config) {
Connections::add($name, $config);
}
}
示例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()));
}
示例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'));
}
示例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()));
}
示例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;
}
示例7: testGetNullAdapter
public function testGetNullAdapter()
{
Connections::reset();
$this->assertTrue(Connections::get(false) instanceof Mock);
}
示例8: testGetNullAdapter
public function testGetNullAdapter()
{
Connections::reset();
$this->assertInstanceOf('lithium\\data\\source\\Mock', Connections::get(false));
}
示例9: tearDown
public function tearDown()
{
Connections::reset();
Connections::config($this->_configs);
}
示例10: tearDown
public function tearDown()
{
Connections::reset();
Connections::config($this->_backup['connections']);
}