Skip to content
Permalink
Browse files

Fixing some failing unit tests

  • Loading branch information...
lorenzo committed Sep 15, 2013
1 parent 6a93360 commit f0bb2f54d319fb94136c6a61177ef70423e8d171
@@ -282,7 +282,7 @@ public function testEagerLoader() {
])
->will($this->returnSelf());
$callable = $association->eagerLoader(compact('keys'));
$callable = $association->eagerLoader(compact('keys', 'query'));
$row = ['Article__id' => 1, 'title' => 'article 1'];
$result = $callable($row);
$row['Tag__Tag'] = [
@@ -347,7 +347,7 @@ public function testEagerLoaderWithDefaults() {
->with(['id' => 'ASC'])
->will($this->returnValue($query));
$association->eagerLoader(compact('keys'));
$association->eagerLoader(compact('keys', 'query'));
}
/**
@@ -413,7 +413,8 @@ public function testEagerLoaderWithOverrides() {
'conditions' => ['Tag.id !=' => 3],
'sort' => ['name' => 'DESC'],
'fields' => ['name', 'ArticleTag.article_id'],
'keys' => $keys
'keys' => $keys,
'query' => $query
]);
}
@@ -450,7 +451,8 @@ public function testEagerLoaderFieldsException() {
$association->eagerLoader([
'keys' => $keys,
'fields' => ['name']
'fields' => ['name'],
'query' => $query
]);
}
@@ -519,7 +521,8 @@ public function testEagerLoaderSubquery() {
->will($this->returnSelf());
$callable = $association->eagerLoader([
'query' => $parent, 'strategy' => BelongsToMany::STRATEGY_SUBQUERY
'query' => $parent, 'strategy' => BelongsToMany::STRATEGY_SUBQUERY,
'keys' => []
]);
$row['Tag__Tag'] = [
@@ -118,7 +118,7 @@ public function testEagerLoader() {
$query->expects($this->once())->method('execute')
->will($this->returnValue($results));
$callable = $association->eagerLoader(compact('keys'));
$callable = $association->eagerLoader(compact('keys', 'query'));
$row = ['Author__id' => 1, 'username' => 'author 1'];
$result = $callable($row);
$row['Article__Article'] = [
@@ -176,7 +176,7 @@ public function testEagerLoaderWithDefaults() {
->with(['id' => 'ASC'])
->will($this->returnValue($query));
$association->eagerLoader(compact('keys'));
$association->eagerLoader(compact('keys', 'query'));
}
/**
@@ -239,7 +239,8 @@ public function testEagerLoaderWithOverrides() {
'sort' => ['title' => 'DESC'],
'fields' => ['title', 'author_id'],
'contain' => ['Category' => ['fields' => ['a', 'b']]],
'keys' => $keys
'keys' => $keys,
'query' => $query
]);
}
@@ -267,7 +268,11 @@ public function testEagerLoaderFieldsException() {
$this->article->expects($this->once())->method('find')->with('all')
->will($this->returnValue($query));
$association->eagerLoader(['fields' => ['id', 'title'], 'keys' => $keys]);
$association->eagerLoader([
'fields' => ['id', 'title'],
'keys' => $keys,
'query' => $query
]);
}
/**
@@ -316,7 +321,7 @@ public function testEagerLoaderSubquery() {
->will($this->returnValue($query));
$callable = $association->eagerLoader([
'query' => $parent, 'strategy' => HasMany::STRATEGY_SUBQUERY
'query' => $parent, 'strategy' => HasMany::STRATEGY_SUBQUERY, 'keys' => []
]);
$row = ['Author__id' => 1, 'username' => 'author 1'];
$result = $callable($row);

0 comments on commit f0bb2f5

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