Permalink
Browse files

Fixing some tests

  • Loading branch information...
1 parent 7d397bc commit fd6a5dbfe16fd7fee9bf7637f14603ba409f8094 @lorenzo lorenzo committed Jan 27, 2014
@@ -256,6 +256,7 @@ protected function _groupTranslations($results) {
$options = ['setter' => false, 'guard' => false];
$row->set('_translations', $result, $options);
unset($row['_i18n']);
+ $row->clean();
return $row;
});
}
@@ -84,6 +84,7 @@ public function eagerLoader(array $options) {
'strategy' => $this->strategy()
];
+ $queryBuilder = false;
if (!empty($options['queryBuilder'])) {
$queryBuilder = $options['queryBuilder'];
unset($options['queryBuilder']);
@@ -394,20 +394,4 @@ public function testTranslationsHasManyWithOverride() {
$this->assertEquals('Obsah #1', $results->first()->body);
}
- public function testFindSingleLocaleBelongsto() {
- $table = TableRegistry::get('Articles');
- $table->addBehavior('Translate', ['fields' => ['title', 'body']]);
- $authors = $table->belongsTo('Authors')->target();
- $authors->addBehavior('Translate', ['fields' => ['name']]);
-
- $table->locale('eng');
- $authors->locale('eng');
-
- $results = $table->find()->contain(['Authors' => function($q) {
- return $q->select(['id', 'name']);
- }]);
-
- debug(json_encode($results->first()->author));
- }
-
}
@@ -396,9 +396,7 @@ public function testEagerLoaderWithQueryBuilder() {
->with(['a', 'b'])
->will($this->returnSelf());
- $query->expects($this->any())->method('join')
- ->will($this->returnSelf());
- $query->expects($this->at(6))->method('join')
+ $query->expects($this->at(3))->method('join')
->with('foo')
->will($this->returnSelf());

0 comments on commit fd6a5db

Please sign in to comment.