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


PHP DboSource::listDetailedSources方法代碼示例

本文整理匯總了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');
 }
開發者ID:laiello,項目名稱:double-l-bookmanagement,代碼行數:14,代碼來源:MysqlTest.php

示例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));
 }
開發者ID:no2key,項目名稱:Web-Framework-Benchmark,代碼行數:23,代碼來源:dbo_mysql.test.php


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