mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-20 16:39:57 +00:00
Fixing failing test caused by registry pollution.
Adding a test case to prove that unqualified column names work with postgresql. Closes #930
This commit is contained in:
parent
596c751ea3
commit
a9bb4eefae
1 changed files with 18 additions and 1 deletions
|
@ -572,7 +572,7 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
date date,
|
date date,
|
||||||
CONSTRAINT test_suite_data_types_pkey PRIMARY KEY (id)
|
CONSTRAINT test_suite_data_types_pkey PRIMARY KEY (id)
|
||||||
)');
|
)');
|
||||||
$model =& ClassRegistry::init('datatypes');
|
$model = new Model(array('name' => 'Datatype', 'ds' => 'test_suite'));
|
||||||
$schema = new CakeSchema(array('connection' => 'test_suite'));
|
$schema = new CakeSchema(array('connection' => 'test_suite'));
|
||||||
$result = $schema->read(array(
|
$result = $schema->read(array(
|
||||||
'connection' => 'test_suite',
|
'connection' => 'test_suite',
|
||||||
|
@ -807,4 +807,21 @@ class DboPostgresTest extends CakeTestCase {
|
||||||
$expected = array('COUNT(DISTINCT FUNC("id"))');
|
$expected = array('COUNT(DISTINCT FUNC("id"))');
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test that saveAll works even with conditions that lack a model name.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function testUpdateAllWithNonQualifiedConditions() {
|
||||||
|
$this->loadFixtures('Article');
|
||||||
|
$Article =& new Article();
|
||||||
|
$result = $Article->updateAll(array('title' => "'Awesome'"), array('published' => 'Y'));
|
||||||
|
$this->assertTrue($result);
|
||||||
|
|
||||||
|
$result = $Article->find('count', array(
|
||||||
|
'conditions' => array('Article.title' => 'Awesome')
|
||||||
|
));
|
||||||
|
$this->assertEqual($result, 3, 'Article count is wrong or fixture has changed.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue