mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Updating documentation to improve code completion
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8114 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
de5907326e
commit
76e0f17dbc
22 changed files with 116 additions and 116 deletions
|
@ -36,7 +36,7 @@ class AclShell extends Shell {
|
||||||
/**
|
/**
|
||||||
* Contains instance of AclComponent
|
* Contains instance of AclComponent
|
||||||
*
|
*
|
||||||
* @var object
|
* @var AclComponent
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $Acl;
|
var $Acl;
|
||||||
|
|
|
@ -34,7 +34,7 @@ class Shell extends Object {
|
||||||
/**
|
/**
|
||||||
* An instance of the ShellDispatcher object that loaded this script
|
* An instance of the ShellDispatcher object that loaded this script
|
||||||
*
|
*
|
||||||
* @var object
|
* @var ShellDispatcher
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $Dispatch = null;
|
var $Dispatch = null;
|
||||||
|
@ -49,7 +49,7 @@ class Shell extends Object {
|
||||||
* Holds the DATABASE_CONFIG object for the app. Null if database.php could not be found,
|
* Holds the DATABASE_CONFIG object for the app. Null if database.php could not be found,
|
||||||
* or the app does not exist.
|
* or the app does not exist.
|
||||||
*
|
*
|
||||||
* @var object
|
* @var DATABASE_CONFIG
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $DbConfig = null;
|
var $DbConfig = null;
|
||||||
|
|
|
@ -33,7 +33,7 @@ class Cache extends Object {
|
||||||
/**
|
/**
|
||||||
* Cache engine to use
|
* Cache engine to use
|
||||||
*
|
*
|
||||||
* @var object
|
* @var CacheEngine
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
var $_Engine = null;
|
var $_Engine = null;
|
||||||
|
|
2
cake/libs/cache/file.php
vendored
2
cake/libs/cache/file.php
vendored
|
@ -34,7 +34,7 @@ class FileEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* Instance of File class
|
* Instance of File class
|
||||||
*
|
*
|
||||||
* @var object
|
* @var File
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
var $__File = null;
|
var $__File = null;
|
||||||
|
|
2
cake/libs/cache/memcache.php
vendored
2
cake/libs/cache/memcache.php
vendored
|
@ -33,7 +33,7 @@ class MemcacheEngine extends CacheEngine {
|
||||||
/**
|
/**
|
||||||
* Memcache wrapper.
|
* Memcache wrapper.
|
||||||
*
|
*
|
||||||
* @var object
|
* @var Memcache
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
var $__Memcache = null;
|
var $__Memcache = null;
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Scaffold extends Object {
|
||||||
/**
|
/**
|
||||||
* Controller object
|
* Controller object
|
||||||
*
|
*
|
||||||
* @var object
|
* @var Controller
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $controller = null;
|
var $controller = null;
|
||||||
|
|
|
@ -70,7 +70,7 @@ class ErrorHandler extends Object {
|
||||||
/**
|
/**
|
||||||
* Controller instance.
|
* Controller instance.
|
||||||
*
|
*
|
||||||
* @var object
|
* @var Controller
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $controller = null;
|
var $controller = null;
|
||||||
|
|
|
@ -42,7 +42,7 @@ class File extends Object {
|
||||||
/**
|
/**
|
||||||
* Folder object of the File
|
* Folder object of the File
|
||||||
*
|
*
|
||||||
* @var object
|
* @var Folder
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $Folder = null;
|
var $Folder = null;
|
||||||
|
@ -376,7 +376,7 @@ class File extends Object {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Returns the full path of the File.
|
* Returns the full path of the File.
|
||||||
*
|
*
|
||||||
* @return string Full path to file
|
* @return string Full path to file
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -40,7 +40,7 @@ class I18n extends Object {
|
||||||
/**
|
/**
|
||||||
* Instance of the I10n class for localization
|
* Instance of the I10n class for localization
|
||||||
*
|
*
|
||||||
* @var object
|
* @var I10n
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $l10n = null;
|
var $l10n = null;
|
||||||
|
|
|
@ -205,11 +205,11 @@ class ModelBehavior extends Object {
|
||||||
* @subpackage cake.cake.libs.model
|
* @subpackage cake.cake.libs.model
|
||||||
*/
|
*/
|
||||||
class BehaviorCollection extends Object {
|
class BehaviorCollection extends Object {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores a reference to the attached name
|
* Stores a reference to the attached name
|
||||||
*
|
*
|
||||||
* @var object
|
* @var string
|
||||||
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $modelName = null;
|
var $modelName = null;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Datasource connection manager
|
* Datasource connection manager
|
||||||
*
|
*
|
||||||
* Provides an interface for loading and enumerating connections defined in app/config/database.php
|
* Provides an interface for loading and enumerating connections defined in app/config/database.php
|
||||||
*
|
*
|
||||||
* PHP versions 4 and 5
|
* PHP versions 4 and 5
|
||||||
*
|
*
|
||||||
|
@ -39,7 +39,7 @@ class ConnectionManager extends Object {
|
||||||
/**
|
/**
|
||||||
* Holds a loaded instance of the Connections object
|
* Holds a loaded instance of the Connections object
|
||||||
*
|
*
|
||||||
* @var object
|
* @var DATABASE_CONFIG
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $config = null;
|
var $config = null;
|
||||||
|
|
|
@ -221,7 +221,7 @@ class Model extends Overloadable {
|
||||||
/**
|
/**
|
||||||
* Holds the Behavior objects currently bound to this model.
|
* Holds the Behavior objects currently bound to this model.
|
||||||
*
|
*
|
||||||
* @var object
|
* @var BehaviorCollection
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $Behaviors = null;
|
var $Behaviors = null;
|
||||||
|
|
|
@ -38,7 +38,7 @@ class Object {
|
||||||
/**
|
/**
|
||||||
* Log object
|
* Log object
|
||||||
*
|
*
|
||||||
* @var object
|
* @var CakeLog
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
var $_log = null;
|
var $_log = null;
|
||||||
|
|
|
@ -42,14 +42,14 @@ class AjaxHelper extends AppHelper {
|
||||||
/**
|
/**
|
||||||
* HtmlHelper instance
|
* HtmlHelper instance
|
||||||
*
|
*
|
||||||
* @var object
|
* @var HtmlHelper
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $Html = null;
|
var $Html = null;
|
||||||
/**
|
/**
|
||||||
* JavaScriptHelper instance
|
* JavaScriptHelper instance
|
||||||
*
|
*
|
||||||
* @var object
|
* @var JavaScriptHelper
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $Javascript = null;
|
var $Javascript = null;
|
||||||
|
@ -901,7 +901,7 @@ class AjaxHelper extends AppHelper {
|
||||||
}
|
}
|
||||||
if (isset($options['bind'])) {
|
if (isset($options['bind'])) {
|
||||||
$bind = $options['bind'];
|
$bind = $options['bind'];
|
||||||
|
|
||||||
$hasBinding = (
|
$hasBinding = (
|
||||||
(is_array($bind) && in_array($callback, $bind)) ||
|
(is_array($bind) && in_array($callback, $bind)) ||
|
||||||
(is_string($bind) && strpos($bind, $callback) !== false)
|
(is_string($bind) && strpos($bind, $callback) !== false)
|
||||||
|
|
|
@ -52,7 +52,7 @@ class CacheHelper extends AppHelper {
|
||||||
/**
|
/**
|
||||||
* holds the View object passed in final call to CacheHelper::cache()
|
* holds the View object passed in final call to CacheHelper::cache()
|
||||||
*
|
*
|
||||||
* @var object
|
* @var View
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $view;
|
var $view;
|
||||||
|
|
|
@ -34,7 +34,7 @@ class MagicDbTest extends UnitTestCase {
|
||||||
/**
|
/**
|
||||||
* The MagicDb instance to be tested
|
* The MagicDb instance to be tested
|
||||||
*
|
*
|
||||||
* @var object
|
* @var MagicDb
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $Db = null;
|
var $Db = null;
|
||||||
|
|
|
@ -182,7 +182,7 @@ class DboAdodbTest extends CakeTestCase {
|
||||||
/**
|
/**
|
||||||
* The Dbo instance to be tested
|
* The Dbo instance to be tested
|
||||||
*
|
*
|
||||||
* @var object
|
* @var DboSource
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $db = null;
|
var $db = null;
|
||||||
|
|
|
@ -54,7 +54,7 @@ class DboMssqlTestDb extends DboMssql {
|
||||||
var $simulated = array();
|
var $simulated = array();
|
||||||
/**
|
/**
|
||||||
* fetchAllResultsStack
|
* fetchAllResultsStack
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
|
@ -72,8 +72,8 @@ class DboMssqlTestDb extends DboMssql {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* fetchAll method
|
* fetchAll method
|
||||||
*
|
*
|
||||||
* @param mixed $sql
|
* @param mixed $sql
|
||||||
* @access protected
|
* @access protected
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -82,8 +82,8 @@ class DboMssqlTestDb extends DboMssql {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* fetchAll method
|
* fetchAll method
|
||||||
*
|
*
|
||||||
* @param mixed $sql
|
* @param mixed $sql
|
||||||
* @access protected
|
* @access protected
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -192,7 +192,7 @@ class DboMssqlTest extends CakeTestCase {
|
||||||
/**
|
/**
|
||||||
* The Dbo instance to be tested
|
* The Dbo instance to be tested
|
||||||
*
|
*
|
||||||
* @var object
|
* @var DboSource
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $db = null;
|
var $db = null;
|
||||||
|
@ -284,7 +284,7 @@ class DboMssqlTest extends CakeTestCase {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* testDescribe method
|
* testDescribe method
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -156,7 +156,7 @@ class DboMysqlTest extends CakeTestCase {
|
||||||
/**
|
/**
|
||||||
* The Dbo instance to be tested
|
* The Dbo instance to be tested
|
||||||
*
|
*
|
||||||
* @var object
|
* @var DboSource
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $Db = null;
|
var $Db = null;
|
||||||
|
@ -372,76 +372,76 @@ class DboMysqlTest extends CakeTestCase {
|
||||||
$name = $this->db->fullTableName('simple');
|
$name = $this->db->fullTableName('simple');
|
||||||
|
|
||||||
$mockDbo =& new QueryMockDboMysql($this);
|
$mockDbo =& new QueryMockDboMysql($this);
|
||||||
$columnData = array(
|
$columnData = array(
|
||||||
array('0' => array(
|
array('0' => array(
|
||||||
'Table' => 'with_compound_keys',
|
'Table' => 'with_compound_keys',
|
||||||
'Non_unique' => '0',
|
'Non_unique' => '0',
|
||||||
'Key_name' => 'PRIMARY',
|
'Key_name' => 'PRIMARY',
|
||||||
'Seq_in_index' => '1',
|
'Seq_in_index' => '1',
|
||||||
'Column_name' => 'id',
|
'Column_name' => 'id',
|
||||||
'Collation' => 'A',
|
'Collation' => 'A',
|
||||||
'Cardinality' => '0',
|
'Cardinality' => '0',
|
||||||
'Sub_part' => NULL,
|
'Sub_part' => NULL,
|
||||||
'Packed' => NULL,
|
'Packed' => NULL,
|
||||||
'Null' => '',
|
'Null' => '',
|
||||||
'Index_type' => 'BTREE',
|
'Index_type' => 'BTREE',
|
||||||
'Comment' => ''
|
|
||||||
)),
|
|
||||||
array('0' => array(
|
|
||||||
'Table' => 'with_compound_keys',
|
|
||||||
'Non_unique' => '1',
|
|
||||||
'Key_name' => 'pointless_bool',
|
|
||||||
'Seq_in_index' => '1',
|
|
||||||
'Column_name' => 'bool',
|
|
||||||
'Collation' => 'A',
|
|
||||||
'Cardinality' => NULL,
|
|
||||||
'Sub_part' => NULL,
|
|
||||||
'Packed' => NULL,
|
|
||||||
'Null' => 'YES',
|
|
||||||
'Index_type' => 'BTREE',
|
|
||||||
'Comment' => ''
|
'Comment' => ''
|
||||||
)),
|
)),
|
||||||
array('0' => array(
|
array('0' => array(
|
||||||
'Table' => 'with_compound_keys',
|
'Table' => 'with_compound_keys',
|
||||||
'Non_unique' => '1',
|
'Non_unique' => '1',
|
||||||
'Key_name' => 'pointless_small_int',
|
'Key_name' => 'pointless_bool',
|
||||||
'Seq_in_index' => '1',
|
'Seq_in_index' => '1',
|
||||||
'Column_name' => 'small_int',
|
'Column_name' => 'bool',
|
||||||
'Collation' => 'A',
|
'Collation' => 'A',
|
||||||
'Cardinality' => NULL,
|
'Cardinality' => NULL,
|
||||||
'Sub_part' => NULL,
|
'Sub_part' => NULL,
|
||||||
'Packed' => NULL,
|
'Packed' => NULL,
|
||||||
'Null' => 'YES',
|
'Null' => 'YES',
|
||||||
'Index_type' => 'BTREE',
|
'Index_type' => 'BTREE',
|
||||||
'Comment' => ''
|
'Comment' => ''
|
||||||
)),
|
)),
|
||||||
array('0' => array(
|
array('0' => array(
|
||||||
'Table' => 'with_compound_keys',
|
'Table' => 'with_compound_keys',
|
||||||
'Non_unique' => '1',
|
'Non_unique' => '1',
|
||||||
'Key_name' => 'one_way',
|
'Key_name' => 'pointless_small_int',
|
||||||
'Seq_in_index' => '1',
|
'Seq_in_index' => '1',
|
||||||
'Column_name' => 'bool',
|
'Column_name' => 'small_int',
|
||||||
'Collation' => 'A',
|
'Collation' => 'A',
|
||||||
'Cardinality' => NULL,
|
'Cardinality' => NULL,
|
||||||
'Sub_part' => NULL,
|
'Sub_part' => NULL,
|
||||||
'Packed' => NULL,
|
'Packed' => NULL,
|
||||||
'Null' => 'YES',
|
'Null' => 'YES',
|
||||||
'Index_type' => 'BTREE',
|
'Index_type' => 'BTREE',
|
||||||
'Comment' => ''
|
'Comment' => ''
|
||||||
)),
|
)),
|
||||||
array('0' => array(
|
array('0' => array(
|
||||||
'Table' => 'with_compound_keys',
|
'Table' => 'with_compound_keys',
|
||||||
'Non_unique' => '1',
|
'Non_unique' => '1',
|
||||||
'Key_name' => 'one_way',
|
'Key_name' => 'one_way',
|
||||||
'Seq_in_index' => '2',
|
'Seq_in_index' => '1',
|
||||||
'Column_name' => 'small_int',
|
'Column_name' => 'bool',
|
||||||
'Collation' => 'A',
|
'Collation' => 'A',
|
||||||
'Cardinality' => NULL,
|
'Cardinality' => NULL,
|
||||||
'Sub_part' => NULL,
|
'Sub_part' => NULL,
|
||||||
'Packed' => NULL,
|
'Packed' => NULL,
|
||||||
'Null' => 'YES',
|
'Null' => 'YES',
|
||||||
'Index_type' => 'BTREE',
|
'Index_type' => 'BTREE',
|
||||||
'Comment' => ''
|
'Comment' => ''
|
||||||
|
)),
|
||||||
|
array('0' => array(
|
||||||
|
'Table' => 'with_compound_keys',
|
||||||
|
'Non_unique' => '1',
|
||||||
|
'Key_name' => 'one_way',
|
||||||
|
'Seq_in_index' => '2',
|
||||||
|
'Column_name' => 'small_int',
|
||||||
|
'Collation' => 'A',
|
||||||
|
'Cardinality' => NULL,
|
||||||
|
'Sub_part' => NULL,
|
||||||
|
'Packed' => NULL,
|
||||||
|
'Null' => 'YES',
|
||||||
|
'Index_type' => 'BTREE',
|
||||||
|
'Comment' => ''
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
$mockDbo->setReturnValue('query', $columnData, array('SHOW INDEX FROM ' . $name));
|
$mockDbo->setReturnValue('query', $columnData, array('SHOW INDEX FROM ' . $name));
|
||||||
|
@ -504,7 +504,7 @@ class DboMysqlTest extends CakeTestCase {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* testAlterSchemaIndexes method
|
* testAlterSchemaIndexes method
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -538,10 +538,10 @@ class DboMysqlTest extends CakeTestCase {
|
||||||
'PRIMARY' => array('column' => 'id', 'unique' => 1))
|
'PRIMARY' => array('column' => 'id', 'unique' => 1))
|
||||||
)));
|
)));
|
||||||
$this->db->query($this->db->alterSchema($schema2->compare($schema1)));
|
$this->db->query($this->db->alterSchema($schema2->compare($schema1)));
|
||||||
|
|
||||||
$indexes = $this->db->index('altertest');
|
$indexes = $this->db->index('altertest');
|
||||||
$this->assertEqual($schema2->tables['altertest']['indexes'], $indexes);
|
$this->assertEqual($schema2->tables['altertest']['indexes'], $indexes);
|
||||||
|
|
||||||
// Change three indexes, delete one and add another one
|
// Change three indexes, delete one and add another one
|
||||||
$schema3 =& new CakeSchema(array(
|
$schema3 =& new CakeSchema(array(
|
||||||
'name' => 'AlterTest3',
|
'name' => 'AlterTest3',
|
||||||
|
@ -552,7 +552,7 @@ class DboMysqlTest extends CakeTestCase {
|
||||||
'group1' => array('type' => 'integer', 'null' => true),
|
'group1' => array('type' => 'integer', 'null' => true),
|
||||||
'group2' => array('type' => 'integer', 'null' => true),
|
'group2' => array('type' => 'integer', 'null' => true),
|
||||||
'indexes' => array(
|
'indexes' => array(
|
||||||
'name_idx' => array('column' => 'name', 'unique' => 1),
|
'name_idx' => array('column' => 'name', 'unique' => 1),
|
||||||
'group_idx' => array('column' => 'group2', 'unique' => 0),
|
'group_idx' => array('column' => 'group2', 'unique' => 0),
|
||||||
'compound_idx' => array('column' => array('group2', 'group1'), 'unique' => 0),
|
'compound_idx' => array('column' => array('group2', 'group1'), 'unique' => 0),
|
||||||
'id_name_idx' => array('column' => array('id', 'name'), 'unique' => 0))
|
'id_name_idx' => array('column' => array('id', 'name'), 'unique' => 0))
|
||||||
|
|
|
@ -159,7 +159,7 @@ class DboMysqliTest extends CakeTestCase {
|
||||||
/**
|
/**
|
||||||
* The Dbo instance to be tested
|
* The Dbo instance to be tested
|
||||||
*
|
*
|
||||||
* @var object
|
* @var DboSource
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $Db = null;
|
var $Db = null;
|
||||||
|
|
|
@ -159,19 +159,19 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
* @var object
|
* @var object
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $fixtures = array('core.user', 'core.binary_test', 'core.comment', 'core.article',
|
var $fixtures = array('core.user', 'core.binary_test', 'core.comment', 'core.article',
|
||||||
'core.tag', 'core.articles_tag', 'core.attachment', 'core.person', 'core.post', 'core.author');
|
'core.tag', 'core.articles_tag', 'core.attachment', 'core.person', 'core.post', 'core.author');
|
||||||
/**
|
/**
|
||||||
* Actual DB connection used in testing
|
* Actual DB connection used in testing
|
||||||
*
|
*
|
||||||
* @var object
|
* @var DboSource
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $db = null;
|
var $db = null;
|
||||||
/**
|
/**
|
||||||
* Simulated DB connection used in testing
|
* Simulated DB connection used in testing
|
||||||
*
|
*
|
||||||
* @var object
|
* @var DboSource
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $db2 = null;
|
var $db2 = null;
|
||||||
|
@ -479,7 +479,7 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
|
|
||||||
$db1->query('DROP TABLE ' . $db1->fullTableName('datatypes'));
|
$db1->query('DROP TABLE ' . $db1->fullTableName('datatypes'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test index generation from table info.
|
* Test index generation from table info.
|
||||||
*
|
*
|
||||||
|
@ -498,7 +498,7 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
$result = $this->db->index($name);
|
$result = $this->db->index($name);
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$this->db->query('DROP TABLE ' . $name);
|
$this->db->query('DROP TABLE ' . $name);
|
||||||
$name = $this->db->fullTableName('index_test_2', false);
|
$name = $this->db->fullTableName('index_test_2', false);
|
||||||
$this->db->query('CREATE TABLE ' . $name . ' ("id" serial NOT NULL PRIMARY KEY, "bool" integer, "small_char" varchar(50), "description" varchar(40) )');
|
$this->db->query('CREATE TABLE ' . $name . ' ("id" serial NOT NULL PRIMARY KEY, "bool" integer, "small_char" varchar(50), "description" varchar(40) )');
|
||||||
|
@ -532,7 +532,7 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
$this->db->query($this->db->createSchema($Old));
|
$this->db->query($this->db->createSchema($Old));
|
||||||
|
|
||||||
$New =& new CakeSchema(array(
|
$New =& new CakeSchema(array(
|
||||||
'connection' => 'test_suite',
|
'connection' => 'test_suite',
|
||||||
'name' => 'AlterPosts',
|
'name' => 'AlterPosts',
|
||||||
|
@ -547,13 +547,13 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
$this->db->query($this->db->alterSchema($New->compare($Old), 'alter_posts'));
|
$this->db->query($this->db->alterSchema($New->compare($Old), 'alter_posts'));
|
||||||
|
|
||||||
$model = new CakeTestModel(array('table' => 'alter_posts', 'ds' => 'test_suite'));
|
$model = new CakeTestModel(array('table' => 'alter_posts', 'ds' => 'test_suite'));
|
||||||
$result = $model->schema();
|
$result = $model->schema();
|
||||||
$this->assertTrue(isset($result['status']));
|
$this->assertTrue(isset($result['status']));
|
||||||
$this->assertFalse(isset($result['published']));
|
$this->assertFalse(isset($result['published']));
|
||||||
$this->assertEqual($result['body']['type'], 'string');
|
$this->assertEqual($result['body']['type'], 'string');
|
||||||
|
|
||||||
$this->db->query($this->db->dropSchema($New));
|
$this->db->query($this->db->dropSchema($New));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -561,7 +561,7 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testAlterIndexes() {
|
function testAlterIndexes() {
|
||||||
$this->db->cacheSources = false;
|
$this->db->cacheSources = false;
|
||||||
|
|
||||||
|
@ -594,10 +594,10 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
$this->db->query($this->db->alterSchema($schema2->compare($schema1)));
|
$this->db->query($this->db->alterSchema($schema2->compare($schema1)));
|
||||||
|
|
||||||
$indexes = $this->db->index('altertest');
|
$indexes = $this->db->index('altertest');
|
||||||
$this->assertEqual($schema2->tables['altertest']['indexes'], $indexes);
|
$this->assertEqual($schema2->tables['altertest']['indexes'], $indexes);
|
||||||
|
|
||||||
// Change three indexes, delete one and add another one
|
// Change three indexes, delete one and add another one
|
||||||
$schema3 =& new CakeSchema(array(
|
$schema3 =& new CakeSchema(array(
|
||||||
'name' => 'AlterTest3',
|
'name' => 'AlterTest3',
|
||||||
|
@ -608,7 +608,7 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
'group1' => array('type' => 'integer', 'null' => true),
|
'group1' => array('type' => 'integer', 'null' => true),
|
||||||
'group2' => array('type' => 'integer', 'null' => true),
|
'group2' => array('type' => 'integer', 'null' => true),
|
||||||
'indexes' => array(
|
'indexes' => array(
|
||||||
'name_idx' => array('column' => 'name', 'unique' => 1),
|
'name_idx' => array('column' => 'name', 'unique' => 1),
|
||||||
'group_idx' => array('column' => 'group2', 'unique' => 0),
|
'group_idx' => array('column' => 'group2', 'unique' => 0),
|
||||||
'compound_idx' => array('column' => array('group2', 'group1'), 'unique' => 0),
|
'compound_idx' => array('column' => array('group2', 'group1'), 'unique' => 0),
|
||||||
'another_idx' => array('column' => array('group1', 'name'), 'unique' => 0))
|
'another_idx' => array('column' => array('group1', 'name'), 'unique' => 0))
|
||||||
|
|
|
@ -83,14 +83,14 @@ class DboSqliteTest extends CakeTestCase {
|
||||||
/**
|
/**
|
||||||
* Actual DB connection used in testing
|
* Actual DB connection used in testing
|
||||||
*
|
*
|
||||||
* @var object
|
* @var DboSource
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $db = null;
|
var $db = null;
|
||||||
/**
|
/**
|
||||||
* Simulated DB connection used in testing
|
* Simulated DB connection used in testing
|
||||||
*
|
*
|
||||||
* @var object
|
* @var DboSource
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
var $db2 = null;
|
var $db2 = null;
|
||||||
|
@ -150,7 +150,7 @@ class DboSqliteTest extends CakeTestCase {
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function testIndex() {
|
function testIndex() {
|
||||||
$name = $this->db->fullTableName('with_a_key');
|
$name = $this->db->fullTableName('with_a_key');
|
||||||
$this->db->query('CREATE TABLE ' . $name . ' ("id" int(11) PRIMARY KEY, "bool" int(1), "small_char" varchar(50), "description" varchar(40) );');
|
$this->db->query('CREATE TABLE ' . $name . ' ("id" int(11) PRIMARY KEY, "bool" int(1), "small_char" varchar(50), "description" varchar(40) );');
|
||||||
|
@ -160,12 +160,12 @@ class DboSqliteTest extends CakeTestCase {
|
||||||
'PRIMARY' => array('column' => 'id', 'unique' => 1),
|
'PRIMARY' => array('column' => 'id', 'unique' => 1),
|
||||||
'pointless_bool' => array('column' => 'bool', 'unique' => 0),
|
'pointless_bool' => array('column' => 'bool', 'unique' => 0),
|
||||||
'char_index' => array('column' => 'small_char', 'unique' => 1),
|
'char_index' => array('column' => 'small_char', 'unique' => 1),
|
||||||
|
|
||||||
);
|
);
|
||||||
$result = $this->db->index($name);
|
$result = $this->db->index($name);
|
||||||
$this->assertEqual($expected, $result);
|
$this->assertEqual($expected, $result);
|
||||||
$this->db->query('DROP TABLE ' . $name);
|
$this->db->query('DROP TABLE ' . $name);
|
||||||
|
|
||||||
$this->db->query('CREATE TABLE ' . $name . ' ("id" int(11) PRIMARY KEY, "bool" int(1), "small_char" varchar(50), "description" varchar(40) );');
|
$this->db->query('CREATE TABLE ' . $name . ' ("id" int(11) PRIMARY KEY, "bool" int(1), "small_char" varchar(50), "description" varchar(40) );');
|
||||||
$this->db->query('CREATE UNIQUE INDEX multi_col ON ' . $name . '("small_char", "bool")');
|
$this->db->query('CREATE UNIQUE INDEX multi_col ON ' . $name . '("small_char", "bool")');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
|
@ -199,7 +199,7 @@ class DboSqliteTest extends CakeTestCase {
|
||||||
$db->cacheSources = false;
|
$db->cacheSources = false;
|
||||||
|
|
||||||
$fileName = '_' . preg_replace('/[^A-Za-z0-9_\-+]/', '_', TMP . $dbName) . '_list';
|
$fileName = '_' . preg_replace('/[^A-Za-z0-9_\-+]/', '_', TMP . $dbName) . '_list';
|
||||||
|
|
||||||
$result = Cache::read($fileName, '_cake_model_');
|
$result = Cache::read($fileName, '_cake_model_');
|
||||||
$this->assertEqual($result, array('test_list'));
|
$this->assertEqual($result, array('test_list'));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue