Revert "Fix coding standards errors."

This reverts commit 3362100512.
This commit is contained in:
mark_story 2012-03-18 12:29:39 -04:00
parent 3362100512
commit 6f8e7f1bc5
4 changed files with 147 additions and 152 deletions

View file

@ -29,7 +29,6 @@ require_once dirname(dirname(dirname(__FILE__))) . DS . 'models.php';
* @package Cake.Test.Case.Model.Datasource.Database
*/
class MysqlTest extends CakeTestCase {
/**
* autoFixtures property
*
@ -121,7 +120,7 @@ class MysqlTest extends CakeTestCase {
$this->assertEquals($expected, $result);
$expected = 'null';
$expected = 'NULL';
$result = $this->Dbo->value('', 'integer');
$this->assertEquals($expected, $result);
@ -268,6 +267,7 @@ class MysqlTest extends CakeTestCase {
$this->Dbo->rawQuery('DROP TABLE ' . $name);
$this->assertEquals($expected, $result);
$name = $this->Dbo->fullTableName('with_a_key');
$this->Dbo->rawQuery('CREATE TABLE ' . $name . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id), KEY `pointless_bool` ( `bool` ));');
$expected = array(
@ -332,7 +332,7 @@ class MysqlTest extends CakeTestCase {
'comment' => 'test'
);
$result = $this->Dbo->buildColumn($data);
$expected = '`testName` DEFAULT null COMMENT \'test\'';
$expected = '`testName` DEFAULT NULL COMMENT \'test\'';
$this->assertEquals($expected, $result);
$data = array(
@ -345,7 +345,7 @@ class MysqlTest extends CakeTestCase {
'collate' => 'utf8_unicode_ci'
);
$result = $this->Dbo->buildColumn($data);
$expected = '`testName` CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT null';
$expected = '`testName` CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL';
$this->assertEquals($expected, $result);
$this->Dbo->columns = $restore;
}
@ -370,8 +370,8 @@ class MysqlTest extends CakeTestCase {
'Column_name' => 'id',
'Collation' => 'A',
'Cardinality' => '0',
'Sub_part' => null,
'Packed' => null,
'Sub_part' => NULL,
'Packed' => NULL,
'Null' => '',
'Index_type' => 'BTREE',
'Comment' => ''
@ -383,9 +383,9 @@ class MysqlTest extends CakeTestCase {
'Seq_in_index' => '1',
'Column_name' => 'bool',
'Collation' => 'A',
'Cardinality' => null,
'Sub_part' => null,
'Packed' => null,
'Cardinality' => NULL,
'Sub_part' => NULL,
'Packed' => NULL,
'Null' => 'YES',
'Index_type' => 'BTREE',
'Comment' => ''
@ -397,9 +397,9 @@ class MysqlTest extends CakeTestCase {
'Seq_in_index' => '1',
'Column_name' => 'small_int',
'Collation' => 'A',
'Cardinality' => null,
'Sub_part' => null,
'Packed' => null,
'Cardinality' => NULL,
'Sub_part' => NULL,
'Packed' => NULL,
'Null' => 'YES',
'Index_type' => 'BTREE',
'Comment' => ''
@ -411,9 +411,9 @@ class MysqlTest extends CakeTestCase {
'Seq_in_index' => '1',
'Column_name' => 'bool',
'Collation' => 'A',
'Cardinality' => null,
'Sub_part' => null,
'Packed' => null,
'Cardinality' => NULL,
'Sub_part' => NULL,
'Packed' => NULL,
'Null' => 'YES',
'Index_type' => 'BTREE',
'Comment' => ''
@ -425,9 +425,9 @@ class MysqlTest extends CakeTestCase {
'Seq_in_index' => '2',
'Column_name' => 'small_int',
'Collation' => 'A',
'Cardinality' => null,
'Sub_part' => null,
'Packed' => null,
'Cardinality' => NULL,
'Sub_part' => NULL,
'Packed' => NULL,
'Null' => 'YES',
'Index_type' => 'BTREE',
'Comment' => ''
@ -512,7 +512,7 @@ class MysqlTest extends CakeTestCase {
$this->Dbo->cacheSources = $this->Dbo->testing = false;
$table = $this->Dbo->fullTableName('altertest');
$schemaA = new CakeSchema(array(
$schema1 = new CakeSchema(array(
'name' => 'AlterTest1',
'connection' => 'test',
'altertest' => array(
@ -521,17 +521,17 @@ class MysqlTest extends CakeTestCase {
'group1' => array('type' => 'integer', 'null' => true),
'group2' => array('type' => 'integer', 'null' => true)
)));
$result = $this->Dbo->createSchema($schemaA);
$this->assertContains('`id` int(11) DEFAULT 0 NOT null,', $result);
$this->assertContains('`name` varchar(50) NOT null,', $result);
$this->assertContains('`group1` int(11) DEFAULT null', $result);
$this->assertContains('`group2` int(11) DEFAULT null', $result);
$result = $this->Dbo->createSchema($schema1);
$this->assertContains('`id` int(11) DEFAULT 0 NOT NULL,', $result);
$this->assertContains('`name` varchar(50) NOT NULL,', $result);
$this->assertContains('`group1` int(11) DEFAULT NULL', $result);
$this->assertContains('`group2` int(11) DEFAULT NULL', $result);
//Test that the string is syntactically correct
$query = $this->Dbo->getConnection()->prepare($result);
$this->assertEquals($result, $query->queryString);
$schemaB = new CakeSchema(array(
$schema2 = new CakeSchema(array(
'name' => 'AlterTest2',
'connection' => 'test',
'altertest' => array(
@ -546,7 +546,7 @@ class MysqlTest extends CakeTestCase {
'PRIMARY' => array('column' => 'id', 'unique' => 1))
)));
$result = $this->Dbo->alterSchema($schemaB->compare($schemaA));
$result = $this->Dbo->alterSchema($schema2->compare($schema1));
$this->assertContains("ALTER TABLE $table", $result);
$this->assertContains('ADD KEY name_idx (`name`),', $result);
$this->assertContains('ADD KEY group_idx (`group1`),', $result);
@ -558,7 +558,7 @@ class MysqlTest extends CakeTestCase {
$this->assertEquals($result, $query->queryString);
// Change three indexes, delete one and add another one
$schemaC = new CakeSchema(array(
$schema3 = new CakeSchema(array(
'name' => 'AlterTest3',
'connection' => 'test',
'altertest' => array(
@ -573,7 +573,7 @@ class MysqlTest extends CakeTestCase {
'id_name_idx' => array('column' => array('id', 'name'), 'unique' => 0))
)));
$result = $this->Dbo->alterSchema($schemaC->compare($schemaB));
$result = $this->Dbo->alterSchema($schema3->compare($schema2));
$this->assertContains("ALTER TABLE $table", $result);
$this->assertContains('DROP PRIMARY KEY,', $result);
$this->assertContains('DROP KEY name_idx,', $result);
@ -588,10 +588,10 @@ class MysqlTest extends CakeTestCase {
$this->assertEquals($result, $query->queryString);
// Compare us to ourself.
$this->assertEquals($schemaC->compare($schemaC), array());
$this->assertEquals($schema3->compare($schema3), array());
// Drop the indexes
$result = $this->Dbo->alterSchema($schemaA->compare($schemaC));
$result = $this->Dbo->alterSchema($schema1->compare($schema3));
$this->assertContains("ALTER TABLE $table", $result);
$this->assertContains('DROP KEY name_idx,', $result);
@ -628,7 +628,7 @@ class MysqlTest extends CakeTestCase {
public function testAlteringTableParameters() {
$this->Dbo->cacheSources = $this->Dbo->testing = false;
$schemaA = new CakeSchema(array(
$schema1 = new CakeSchema(array(
'name' => 'AlterTest1',
'connection' => 'test',
'altertest' => array(
@ -641,8 +641,8 @@ class MysqlTest extends CakeTestCase {
)
)
));
$this->Dbo->rawQuery($this->Dbo->createSchema($schemaA));
$schemaB = new CakeSchema(array(
$this->Dbo->rawQuery($this->Dbo->createSchema($schema1));
$schema2 = new CakeSchema(array(
'name' => 'AlterTest1',
'connection' => 'test',
'altertest' => array(
@ -655,7 +655,7 @@ class MysqlTest extends CakeTestCase {
)
)
));
$result = $this->Dbo->alterSchema($schemaB->compare($schemaA));
$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);
@ -666,7 +666,7 @@ class MysqlTest extends CakeTestCase {
$this->assertEquals($result['Engine'], 'InnoDB');
$this->assertEquals($result['charset'], 'utf8');
$this->Dbo->rawQuery($this->Dbo->dropSchema($schemaA));
$this->Dbo->rawQuery($this->Dbo->dropSchema($schema1));
}
/**
@ -828,6 +828,7 @@ class MysqlTest extends CakeTestCase {
)
));
$this->Dbo->execute($this->Dbo->createSchema($schema));
$model = new CakeTestModel(array('table' => 'testdescribes', 'name' => 'Testdescribes'));
$result = $model->getDataSource()->describe($model);
@ -1096,7 +1097,7 @@ class MysqlTest extends CakeTestCase {
* @param array $data
* @return array
*/
protected function _scrubQueryData($data) {
function _scrubQueryData($data) {
static $base = null;
if ($base === null) {
$base = array_fill_keys(array('conditions', 'fields', 'joins', 'order', 'limit', 'offset', 'group'), array());
@ -1483,7 +1484,7 @@ class MysqlTest extends CakeTestCase {
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
$backup = $this->Model->hasMany['TestModel6'];
$__backup = $this->Model->hasMany['TestModel6'];
$this->Model->hasMany['TestModel6']['offset'] = 2;
$this->Model->hasMany['TestModel6']['limit'] = 5;
@ -1507,7 +1508,7 @@ class MysqlTest extends CakeTestCase {
$this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result);
$this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result);
$this->Model->hasMany['TestModel6'] = $backup;
$this->Model->hasMany['TestModel6'] = $__backup;
}
/**
@ -1520,7 +1521,7 @@ class MysqlTest extends CakeTestCase {
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
$backup = $this->Model->hasMany['TestModel6'];
$__backup = $this->Model->hasMany['TestModel6'];
$this->Model->hasMany['TestModel6']['page'] = 2;
$this->Model->hasMany['TestModel6']['limit'] = 5;
@ -1543,7 +1544,7 @@ class MysqlTest extends CakeTestCase {
$this->assertRegExp('/\s+FROM\s+\S+`test_model5` AS `TestModel5`\s+WHERE\s+/', $result);
$this->assertRegExp('/\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result);
$this->Model->hasMany['TestModel6'] = $backup;
$this->Model->hasMany['TestModel6'] = $__backup;
}
/**
@ -1762,7 +1763,7 @@ class MysqlTest extends CakeTestCase {
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
$backup = $this->Model->hasAndBelongsToMany['TestModel7'];
$__backup = $this->Model->hasAndBelongsToMany['TestModel7'];
$this->Model->hasAndBelongsToMany['TestModel7']['offset'] = 2;
$this->Model->hasAndBelongsToMany['TestModel7']['limit'] = 5;
@ -1785,7 +1786,7 @@ class MysqlTest extends CakeTestCase {
$this->assertRegExp('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result);
$this->assertRegExp('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result);
$this->Model->hasAndBelongsToMany['TestModel7'] = $backup;
$this->Model->hasAndBelongsToMany['TestModel7'] = $__backup;
}
/**
@ -1798,7 +1799,7 @@ class MysqlTest extends CakeTestCase {
$this->Model->schema();
$this->_buildRelatedModels($this->Model);
$backup = $this->Model->hasAndBelongsToMany['TestModel7'];
$__backup = $this->Model->hasAndBelongsToMany['TestModel7'];
$this->Model->hasAndBelongsToMany['TestModel7']['page'] = 2;
$this->Model->hasAndBelongsToMany['TestModel7']['limit'] = 5;
@ -1821,7 +1822,7 @@ class MysqlTest extends CakeTestCase {
$this->assertRegExp('/^SELECT\s+`TestModel4`\.`id`, `TestModel4`\.`name`, `TestModel4`\.`created`, `TestModel4`\.`updated`\s+/', $result);
$this->assertRegExp('/\s+FROM\s+\S+`test_model4` AS `TestModel4`\s+WHERE\s+(?:\()?1\s+=\s+1(?:\))?\s*$/', $result);
$this->Model->hasAndBelongsToMany['TestModel7'] = $backup;
$this->Model->hasAndBelongsToMany['TestModel7'] = $__backup;
}
/**
@ -1895,20 +1896,20 @@ class MysqlTest extends CakeTestCase {
$expected = ' WHERE `Sportstaette`.`sportstaettenart_id` = 2 AND `Sportstaette`.`sportstaette` LIKE "%ru%"';
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions('SUM(Post.comments_count) > 500 AND NOT Post.title IS null AND NOT Post.extended_title IS null');
$expected = ' WHERE SUM(`Post`.`comments_count`) > 500 AND NOT `Post`.`title` IS null AND NOT `Post`.`extended_title` IS null';
$result = $this->Dbo->conditions('SUM(Post.comments_count) > 500 AND NOT Post.title IS NULL AND NOT Post.extended_title IS NULL');
$expected = ' WHERE SUM(`Post`.`comments_count`) > 500 AND NOT `Post`.`title` IS NULL AND NOT `Post`.`extended_title` IS NULL';
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions('NOT Post.title IS null AND NOT Post.extended_title IS null AND SUM(Post.comments_count) > 500');
$expected = ' WHERE NOT `Post`.`title` IS null AND NOT `Post`.`extended_title` IS null AND SUM(`Post`.`comments_count`) > 500';
$result = $this->Dbo->conditions('NOT Post.title IS NULL AND NOT Post.extended_title IS NULL AND SUM(Post.comments_count) > 500');
$expected = ' WHERE NOT `Post`.`title` IS NULL AND NOT `Post`.`extended_title` IS NULL AND SUM(`Post`.`comments_count`) > 500';
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions('NOT Post.extended_title IS null AND NOT Post.title IS null AND Post.title != "" AND SPOON(SUM(Post.comments_count) + 1.1) > 500');
$expected = ' WHERE NOT `Post`.`extended_title` IS null AND NOT `Post`.`title` IS null AND `Post`.`title` != "" AND SPOON(SUM(`Post`.`comments_count`) + 1.1) > 500';
$result = $this->Dbo->conditions('NOT Post.extended_title IS NULL AND NOT Post.title IS NULL AND Post.title != "" AND SPOON(SUM(Post.comments_count) + 1.1) > 500');
$expected = ' WHERE NOT `Post`.`extended_title` IS NULL AND NOT `Post`.`title` IS NULL AND `Post`.`title` != "" AND SPOON(SUM(`Post`.`comments_count`) + 1.1) > 500';
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions('NOT Post.title_extended IS null AND NOT Post.title IS null AND Post.title_extended != Post.title');
$expected = ' WHERE NOT `Post`.`title_extended` IS null AND NOT `Post`.`title` IS null AND `Post`.`title_extended` != `Post`.`title`';
$result = $this->Dbo->conditions('NOT Post.title_extended IS NULL AND NOT Post.title IS NULL AND Post.title_extended != Post.title');
$expected = ' WHERE NOT `Post`.`title_extended` IS NULL AND NOT `Post`.`title` IS NULL AND `Post`.`title_extended` != `Post`.`title`';
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions("Comment.id = 'a'");
@ -1975,6 +1976,7 @@ class MysqlTest extends CakeTestCase {
$expected = ' WHERE `Member`.`email` = \'mariano@cricava.com\' AND `Member`.`user` LIKE \'mariano.iglesias%\'';
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions('Member.email = "mariano@cricava.com" AND Member.user LIKE "mariano.iglesias%"');
$expected = ' WHERE `Member`.`email` = "mariano@cricava.com" AND `Member`.`user` LIKE "mariano.iglesias%"';
$this->assertEquals($expected, $result);
@ -2140,11 +2142,11 @@ class MysqlTest extends CakeTestCase {
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions(array('score' => array()));
$expected = " WHERE `score` IS null";
$expected = " WHERE `score` IS NULL";
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions(array('score !=' => array()));
$expected = " WHERE `score` IS NOT null";
$expected = " WHERE `score` IS NOT NULL";
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions(array('score !=' => '20'));
@ -2200,11 +2202,11 @@ class MysqlTest extends CakeTestCase {
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions(array(array('Project.removed' => null)));
$expected = " WHERE `Project`.`removed` IS null";
$expected = " WHERE `Project`.`removed` IS NULL";
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions(array(array('Project.removed !=' => null)));
$expected = " WHERE `Project`.`removed` IS NOT null";
$expected = " WHERE `Project`.`removed` IS NOT NULL";
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions(array('(Usergroup.permissions) & 4' => 4));
@ -2227,7 +2229,7 @@ class MysqlTest extends CakeTestCase {
'NOT' => array('Course.id' => null, 'Course.vet' => 'N', 'level_of_education_id' => array(912,999)),
'Enrollment.yearcompleted >' => '0')
);
$this->assertRegExp('/^\s*WHERE\s+\(NOT\s+\(`Course`\.`id` IS null\)\s+AND NOT\s+\(`Course`\.`vet`\s+=\s+\'N\'\)\s+AND NOT\s+\(level_of_education_id IN \(912, 999\)\)\)\s+AND\s+`Enrollment`\.`yearcompleted`\s+>\s+\'0\'\s*$/', $result);
$this->assertRegExp('/^\s*WHERE\s+\(NOT\s+\(`Course`\.`id` IS NULL\)\s+AND NOT\s+\(`Course`\.`vet`\s+=\s+\'N\'\)\s+AND NOT\s+\(level_of_education_id IN \(912, 999\)\)\)\s+AND\s+`Enrollment`\.`yearcompleted`\s+>\s+\'0\'\s*$/', $result);
$result = $this->Dbo->conditions(array('id <>' => '8'));
$this->assertRegExp('/^\s*WHERE\s+`id`\s+<>\s+\'8\'\s*$/', $result);
@ -2294,12 +2296,12 @@ class MysqlTest extends CakeTestCase {
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions(array("Book.id" => null));
$expected = " WHERE `Book`.`id` IS null";
$expected = " WHERE `Book`.`id` IS NULL";
$this->assertEquals($expected, $result);
$conditions = array('MysqlModel.id' => '');
$result = $this->Dbo->conditions($conditions, true, true, $this->model);
$expected = " WHERE `MysqlModel`.`id` IS null";
$expected = " WHERE `MysqlModel`.`id` IS NULL";
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions(array('Listing.beds >=' => 0));
@ -2673,8 +2675,8 @@ class MysqlTest extends CakeTestCase {
$expected = ' ORDER BY 3963.191 * id ASC';
$this->assertEquals($expected, $result);
$result = $this->Dbo->order(array('Property.sale_price IS null'));
$expected = ' ORDER BY `Property`.`sale_price` IS null ASC';
$result = $this->Dbo->order(array('Property.sale_price IS NULL'));
$expected = ' ORDER BY `Property`.`sale_price` IS NULL ASC';
$this->assertEquals($expected, $result);
}
@ -2815,7 +2817,7 @@ class MysqlTest extends CakeTestCase {
'key'
);
$result = $this->Dbo->buildColumn($data);
$expected = '`testName` varchar(255) DEFAULT null';
$expected = '`testName` varchar(255) DEFAULT NULL';
$this->assertEquals($expected, $result);
$data = array(
@ -2828,7 +2830,7 @@ class MysqlTest extends CakeTestCase {
$this->Dbo->columns = array('integer' => array('name' => 'int', 'limit' => '11', 'formatter' => 'intval'), );
$result = $this->Dbo->buildColumn($data);
$expected = '`int_field` int(11) NOT null';
$expected = '`int_field` int(11) NOT NULL';
$this->assertEquals($expected, $result);
$this->Dbo->fieldParameters['param'] = array(
@ -2847,7 +2849,7 @@ class MysqlTest extends CakeTestCase {
'param' => 'BAD'
);
$result = $this->Dbo->buildColumn($data);
$expected = '`int_field` int(11) NOT null';
$expected = '`int_field` int(11) NOT NULL';
$this->assertEquals($expected, $result);
$data = array(
@ -2858,7 +2860,7 @@ class MysqlTest extends CakeTestCase {
'param' => 'GOOD'
);
$result = $this->Dbo->buildColumn($data);
$expected = '`int_field` int(11) COLLATE GOOD NOT null';
$expected = '`int_field` int(11) COLLATE GOOD NOT NULL';
$this->assertEquals($expected, $result);
$this->Dbo->columns = $restore;
@ -2870,7 +2872,7 @@ class MysqlTest extends CakeTestCase {
'null' => false,
);
$result = $this->Dbo->buildColumn($data);
$expected = '`created` timestamp DEFAULT CURRENT_TIMESTAMP NOT null';
$expected = '`created` timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL';
$this->assertEquals($expected, $result);
$data = array(
@ -2889,7 +2891,7 @@ class MysqlTest extends CakeTestCase {
'null' => true,
);
$result = $this->Dbo->buildColumn($data);
$expected = '`modified` timestamp null';
$expected = '`modified` timestamp NULL';
$this->assertEquals($expected, $result);
$data = array(
@ -2899,7 +2901,7 @@ class MysqlTest extends CakeTestCase {
'null' => true,
);
$result = $this->Dbo->buildColumn($data);
$expected = '`modified` timestamp null';
$expected = '`modified` timestamp NULL';
$this->assertEquals($expected, $result);
}
@ -2947,6 +2949,7 @@ class MysqlTest extends CakeTestCase {
$this->Dbo->hasAny($this->Model, array('TestModel.name' => 'harry'));
$this->Dbo->hasAny($this->Model, array());
}
/**
@ -3305,14 +3308,16 @@ class MysqlTest extends CakeTestCase {
$data = array(2, 2.2);
$this->assertEquals($this->Dbo->introspectType($data), 'integer');
// null
// NULL
$result = $this->Dbo->value(null, 'boolean');
$this->assertEquals($result, 'null');
$this->assertEquals($result, 'NULL');
// EMPTY STRING
$result = $this->Dbo->value('', 'boolean');
$this->assertEquals($result, "'0'");
// BOOLEAN
$result = $this->Dbo->value('true', 'boolean');
$this->assertEquals($result, "'1'");
@ -3514,6 +3519,7 @@ class MysqlTest extends CakeTestCase {
$this->Dbo->update($Article, array('field1'), array('value1'));
$this->Dbo->update($Article, array('field1'), array('2'), '2=2');
$this->Dbo->update($Article, array('field1'), array("'value'"), array('index' => 'val'));
}
/**

View file

@ -56,7 +56,6 @@ class DboPostgresTestDb extends Postgres {
public function getLastQuery() {
return $this->simulated[count($this->simulated) - 1];
}
}
/**
@ -144,7 +143,6 @@ class PostgresTestModel extends Model {
'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
);
}
}
/**
@ -182,7 +180,6 @@ class PostgresClientTestModel extends Model {
'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null)
);
}
}
/**
@ -544,10 +541,12 @@ class PostgresTest extends CakeTestCase {
$schema->tables = array('datatype_tests' => $result['tables']['missing']['datatype_tests']);
$result = $db1->createSchema($schema, 'datatype_tests');
$this->assertNotRegExp('/timestamp DEFAULT/', $result);
$this->assertRegExp('/\"full_length\"\s*text\s.*,/', $result);
$this->assertRegExp('/timestamp\s*,/', $result);
$db1->query('DROP TABLE ' . $db1->fullTableName('datatype_tests'));
$db1->query($result);
@ -732,7 +731,7 @@ class PostgresTest extends CakeTestCase {
$this->Dbo->query($this->Dbo->dropSchema($schema1));
}
/**
/*
* Test it is possible to use virtual field with postgresql
*
* @return void
@ -784,10 +783,7 @@ class PostgresTest extends CakeTestCase {
}
/**
* Test it is possible to do a SELECT COUNT(DISTINCT Model.field)
* query in postgres and it gets correctly quoted
*
* @return void
* Test it is possible to do a SELECT COUNT(DISTINCT Model.field) query in postgres and it gets correctly quoted
*/
public function testQuoteDistinctInFunction() {
$this->loadFixtures('Article');

View file

@ -55,7 +55,6 @@ class DboSqliteTestDb extends Sqlite {
public function getLastQuery() {
return $this->simulated[count($this->simulated) - 1];
}
}
/**

View file

@ -104,7 +104,6 @@ class SqlserverTestDb extends Sqlserver {
public function describe($model) {
return empty($this->describe) ? parent::describe($model) : $this->describe;
}
}
/**
@ -177,7 +176,6 @@ class SqlserverTestModel extends CakeTestModel {
public function find($conditions = null, $fields = null, $order = null, $recursive = null) {
return $conditions;
}
}
/**
@ -186,7 +184,6 @@ class SqlserverTestModel extends CakeTestModel {
* @package Cake.Test.Case.Model.Datasource.Database
*/
class SqlserverClientTestModel extends CakeTestModel {
/**
* name property
*
@ -221,14 +218,12 @@ class SqlserverClientTestModel extends CakeTestModel {
* @package Cake.Test.Case.Model.Datasource.Database
*/
class SqlserverTestResultIterator extends ArrayIterator {
/**
* closeCursor method
*
* @return void
*/
public function closeCursor() {
}
public function closeCursor() {}
/**
* fetch method
@ -243,7 +238,6 @@ class SqlserverTestResultIterator extends ArrayIterator {
$this->next();
return $current;
}
}
/**