|
@@ -39,7 +39,8 @@ class QueryRegressionTest extends TestCase {
|
|
|
'core.tag',
|
|
'core.tag',
|
|
|
'core.articles_tag',
|
|
'core.articles_tag',
|
|
|
'core.author',
|
|
'core.author',
|
|
|
- 'core.special_tag'
|
|
|
|
|
|
|
+ 'core.special_tag',
|
|
|
|
|
+ 'core.translate',
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -405,4 +406,22 @@ class QueryRegressionTest extends TestCase {
|
|
|
$this->assertNotEmpty($resultA->articles_tag->author);
|
|
$this->assertNotEmpty($resultA->articles_tag->author);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Test that offset/limit are elided from subquery loads.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return void
|
|
|
|
|
+ */
|
|
|
|
|
+ public function testAssociationSubQueryNoOffset() {
|
|
|
|
|
+ $table = TableRegistry::get('Articles');
|
|
|
|
|
+ $table->addBehavior('Translate', ['fields' => ['title', 'body']]);
|
|
|
|
|
+ $table->locale('eng');
|
|
|
|
|
+ $query = $table->find('translations')->limit(10)->offset(1);
|
|
|
|
|
+ $result = $query->toArray();
|
|
|
|
|
+ $this->assertCount(2, $result);
|
|
|
|
|
+
|
|
|
|
|
+ $query = $table->find('translations')->having(['Articles.id >' => 1]);
|
|
|
|
|
+ $result = $query->toArray();
|
|
|
|
|
+ $this->assertCount(2, $result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|