本文整理匯總了PHP中DboSource::listDetailedSources方法的典型用法代碼示例。如果您正苦於以下問題:PHP DboSource::listDetailedSources方法的具體用法?PHP DboSource::listDetailedSources怎麽用?PHP DboSource::listDetailedSources使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DboSource
的用法示例。
在下文中一共展示了DboSource::listDetailedSources方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testListDetailedSourcesNamed
/**
* test that listDetailedSources with a named table that doesn't exist.
*
* @return void
*/
public function testListDetailedSourcesNamed()
{
$this->loadFixtures('Apple');
$result = $this->Dbo->listDetailedSources('imaginary');
$this->assertEquals(array(), $result, 'Should be empty when table does not exist.');
$result = $this->Dbo->listDetailedSources();
$tableName = $this->Dbo->fullTableName('apples', false, false);
$this->assertTrue(isset($result[$tableName]), 'Key should exist');
}
示例2: testAlteringTableParameters
/**
* test altering the table settings with schema.
*
* @return void
*/
function testAlteringTableParameters()
{
App::import('Model', 'CakeSchema');
$this->Dbo->cacheSources = $this->Dbo->testing = false;
$schema1 = new CakeSchema(array('name' => 'AlterTest1', 'connection' => 'test', 'altertest' => array('id' => array('type' => 'integer', 'null' => false, 'default' => 0), 'name' => array('type' => 'string', 'null' => false, 'length' => 50), 'tableParameters' => array('charset' => 'latin1', 'collate' => 'latin1_general_ci', 'engine' => 'MyISAM'))));
$this->Dbo->rawQuery($this->Dbo->createSchema($schema1));
$schema2 = new CakeSchema(array('name' => 'AlterTest1', 'connection' => 'test', 'altertest' => array('id' => array('type' => 'integer', 'null' => false, 'default' => 0), 'name' => array('type' => 'string', 'null' => false, 'length' => 50), 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB'))));
$result = $this->Dbo->alterSchema($schema2->compare($schema1));
$this->assertContains('DEFAULT CHARSET=utf8', $result);
$this->assertContains('ENGINE=InnoDB', $result);
$this->assertContains('COLLATE=utf8_general_ci', $result);
$this->Dbo->rawQuery($result);
$result = $this->Dbo->listDetailedSources('altertest');
$this->assertEqual($result['Collation'], 'utf8_general_ci');
$this->assertEqual($result['Engine'], 'InnoDB');
$this->assertEqual($result['charset'], 'utf8');
$this->Dbo->rawQuery($this->Dbo->dropSchema($schema1));
}