Skip to content
Permalink
Browse files

Implemented a simple eager loading for has many associations

  • Loading branch information...
lorenzo committed May 19, 2013
1 parent 77645e1 commit 1040f3ad3bdec5470d8025cf73eaa4f3662059ce
Showing with 10 additions and 10 deletions.
  1. +10 −10 lib/Cake/Test/TestCase/ORM/QueryTest.php
@@ -311,11 +311,11 @@ public function testContainResultFetchingOneLevel() {
}
/**
* Tests that results are grouped correctly when using contain()
* Tests that HasMany associations are correctly eager loaded
*
* @return void
**/
public function testThing() {
public function testHasManyEagerLoading() {
$this->_insertTwoRecords();
$query = new Query($this->connection);
@@ -345,16 +345,16 @@ public function testThing() {
'author' => [
'id' => 2,
'name' => 'Bruce Lee',
'article' => [
[
'article' => [
'id' => 2,
'title' => 'another title',
'body' => 'another body',
'author_id' => 2
]
'article' => [
[
'article' => [
'id' => 2,
'title' => 'another title',
'body' => 'another body',
'author_id' => 2
]
]
]
]
]
];

0 comments on commit 1040f3a

Please sign in to comment.
You can’t perform that action at this time.