Fixing [Only variable references should be returned by reference]

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4778 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-04-05 04:47:01 +00:00
parent 08526db3f4
commit 1c6c32981e
2 changed files with 25 additions and 24 deletions

View file

@ -198,7 +198,8 @@ class ConnectionManager extends Object {
$_this =& ConnectionManager::getInstance();
if (empty($name) || empty($config) || array_key_exists($name, $_this->_connectionsEnum)) {
return null;
$null = null;
return $null;
}
$_this->config->{$name} = $config;

View file

@ -595,35 +595,35 @@ class DboSourceTest extends UnitTestCase {
$result = $this->db->generateSelfAssociationQuery($this->model, $params['linkModel'], $params['type'], $params['assoc'], $params['assocData'], $queryData, $params['external'], $resultSet);
$this->assertTrue($result);
$expected = array (array (
'fields' => array (
'`TestModel4`.`id`',
'`TestModel4`.`name`',
'`TestModel4`.`created`',
'`TestModel4`.`updated`',
'`TestModel4Parent`.`id`',
'`TestModel4Parent`.`name`',
'`TestModel4Parent`.`created`',
$expected = array (array (
'fields' => array (
'`TestModel4`.`id`',
'`TestModel4`.`name`',
'`TestModel4`.`created`',
'`TestModel4`.`updated`',
'`TestModel4Parent`.`id`',
'`TestModel4Parent`.`name`',
'`TestModel4Parent`.`created`',
'`TestModel4Parent`.`updated`'
),
'joins' => array (
array (
'table' => '`test_model4`',
'alias' => 'TestModel4Parent',
'type' => 'LEFT',
'conditions' => array (
),
'joins' => array (
array (
'table' => '`test_model4`',
'alias' => 'TestModel4Parent',
'type' => 'LEFT',
'conditions' => array (
'`TestModel4`.`parent_id`' => '{$__cakeIdentifier[TestModel4Parent.id]__$}'
)
)
),
'table' => '`test_model4`',
'alias' => 'TestModel4',
'limit' => array ( ),
'offset' => array ( ),
'conditions' => array ( ),
),
'table' => '`test_model4`',
'alias' => 'TestModel4',
'limit' => array ( ),
'offset' => array ( ),
'conditions' => array ( ),
'order' => array ( )
));
$this->assertEqual($queryData['selfJoin'], $expected);
$result = $this->db->generateAssociationQuery($this->model, $null, null, null, null, $queryData, false, $null);