Skip to content

Commit

Permalink
Fixing some failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Mar 27, 2014
1 parent 889f835 commit 6ef9579
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions tests/TestCase/ORM/Association/BelongsToManyTest.php
Expand Up @@ -439,14 +439,14 @@ public function testEagerLoader() {
$callable = $association->eagerLoader(compact('keys', 'query'));
$row = ['Articles__id' => 1, 'title' => 'article 1'];
$result = $callable($row);
$row['Tags__Tags'] = [
$row['Tags___collection_'] = [
['id' => 1, 'name' => 'foo', '_joinData' => ['article_id' => 1]]
];
$this->assertEquals($row, $result);

$row = ['Articles__id' => 2, 'title' => 'article 2'];
$result = $callable($row);
$row['Tags__Tags'] = [
$row['Tags___collection_'] = [
['id' => 2, 'name' => 'bar', '_joinData' => ['article_id' => 2]]
];
$this->assertEquals($row, $result);
Expand Down Expand Up @@ -682,14 +682,14 @@ public function testEagerLoaderSubquery() {
'keys' => []
]);

$row['Tags__Tags'] = [
$row['Tags___collection_'] = [
['id' => 1, 'name' => 'foo', '_joinData' => ['article_id' => 1]]
];
$row['Articles__id'] = 1;
$result = $callable($row);
$this->assertEquals($row, $result);

$row['Tags__Tags'] = [
$row['Tags___collection_'] = [
['id' => 2, 'name' => 'bar', '_joinData' => ['article_id' => 2]]
];
$row['Articles__id'] = 2;
Expand Down Expand Up @@ -834,7 +834,7 @@ public function testEagerLoaderMultipleKeys() {
$callable = $association->eagerLoader(compact('keys', 'query'));
$row = ['Articles__id' => 1, 'title' => 'article 1', 'Articles__site_id' => 1];
$result = $callable($row);
$row['Tags__Tags'] = [
$row['Tags___collection_'] = [
[
'id' => 1,
'name' => 'foo',
Expand All @@ -846,7 +846,7 @@ public function testEagerLoaderMultipleKeys() {

$row = ['Articles__id' => 2, 'title' => 'article 2', 'Articles__site_id' => 2];
$result = $callable($row);
$row['Tags__Tags'] = [
$row['Tags___collection_'] = [
[
'id' => 2,
'name' => 'bar',
Expand Down
12 changes: 6 additions & 6 deletions tests/TestCase/ORM/Association/HasManyTest.php
Expand Up @@ -132,14 +132,14 @@ public function testEagerLoader() {
$callable = $association->eagerLoader(compact('keys', 'query'));
$row = ['Authors__id' => 1, 'username' => 'author 1'];
$result = $callable($row);
$row['Articles__Articles'] = [
$row['Articles___collection_'] = [
['id' => 2, 'title' => 'article 2', 'author_id' => 1]
];
$this->assertEquals($row, $result);

$row = ['Authors__id' => 2, 'username' => 'author 2'];
$result = $callable($row);
$row['Articles__Articles'] = [
$row['Articles___collection_'] = [
['id' => 1, 'title' => 'article 1', 'author_id' => 2]
];
$this->assertEquals($row, $result);
Expand Down Expand Up @@ -347,14 +347,14 @@ public function testEagerLoaderSubquery() {
]);
$row = ['Authors__id' => 1, 'username' => 'author 1'];
$result = $callable($row);
$row['Articles__Articles'] = [
$row['Articles___collection_'] = [
['id' => 2, 'title' => 'article 2', 'author_id' => 1]
];
$this->assertEquals($row, $result);

$row = ['Authors__id' => 2, 'username' => 'author 2'];
$result = $callable($row);
$row['Articles__Articles'] = [
$row['Articles___collection_'] = [
['id' => 1, 'title' => 'article 1', 'author_id' => 2]
];
$this->assertEquals($row, $result);
Expand Down Expand Up @@ -447,14 +447,14 @@ public function testEagerLoaderMultipleKeys() {
$callable = $association->eagerLoader(compact('keys', 'query'));
$row = ['Authors__id' => 2, 'Authors__site_id' => 10, 'username' => 'author 1'];
$result = $callable($row);
$row['Articles__Articles'] = [
$row['Articles___collection_'] = [
['id' => 1, 'title' => 'article 1', 'author_id' => 2, 'site_id' => 10]
];
$this->assertEquals($row, $result);

$row = ['Authors__id' => 1, 'username' => 'author 2', 'Authors__site_id' => 20];
$result = $callable($row);
$row['Articles__Articles'] = [
$row['Articles___collection_'] = [
['id' => 2, 'title' => 'article 2', 'author_id' => 1, 'site_id' => 20]
];
$this->assertEquals($row, $result);
Expand Down

0 comments on commit 6ef9579

Please sign in to comment.