mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-04 18:42:40 +00:00
Fixed test case for normalizeFindParams
Slightly refactored normalizeFindParams git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6017 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
f9e8e82b5b
commit
266d7ba738
2 changed files with 6 additions and 9 deletions
|
@ -2082,11 +2082,8 @@ class Model extends Overloadable {
|
|||
|
||||
if (!empty($children)) {
|
||||
if ($_this->name == $name) {
|
||||
$tmp = $this->normalizeFindParams($type, $children, @$r[$name]);
|
||||
$tmp = Set::merge($tmp, array($name => $r));
|
||||
$r = am($r, $tmp[$name]);
|
||||
$r = am($r, $this->normalizeFindParams($type, $children, $r, $_this));
|
||||
} else {
|
||||
//$r['_self'] = $name;
|
||||
$r[$name] = $this->normalizeFindParams($type, $children, @$r[$name], $_this->{$name});;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -464,14 +464,14 @@ class ModelTest extends CakeTestCase {
|
|||
$this->model =& new Article();
|
||||
|
||||
$result = $this->model->normalizeFindParams('fields', array(
|
||||
'title', 'body', 'published', 'Article.id',
|
||||
'User', 'Comment.id', 'Comment.comment', 'Comment.User.password', 'Comment.Article',
|
||||
'Tag' => array('id', 'tag'))
|
||||
'title', 'body', 'published',
|
||||
'Article.id', 'User', 'Comment.id', 'Comment.comment', 'Comment.User.password', 'Comment.Article',
|
||||
'Tag' => array('id', 'tag')
|
||||
)
|
||||
);
|
||||
|
||||
$expected = array(
|
||||
'Article' => array(
|
||||
'fields' => array('id', 'title', 'body', 'published'),
|
||||
'fields' => array('title', 'body', 'published', 'id'),
|
||||
'User' => array('fields' => null),
|
||||
'Comment' => array(
|
||||
'fields' => array('id', 'comment'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue