File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1861,6 +1861,24 @@ public function testContainWithQueryBuilderJoinableAssociation()
1861
1861
$ this ->assertEquals (1 , $ result [0 ]->author ->id );
1862
1862
}
1863
1863
1864
+ /**
1865
+ * Test containing associations that have empty conditions.
1866
+ *
1867
+ * @return void
1868
+ */
1869
+ public function testContainAssociationWithEmptyConditions ()
1870
+ {
1871
+ $ articles = TableRegistry::get ('Articles ' );
1872
+ $ articles ->belongsTo ('Authors ' , [
1873
+ 'conditions ' => function ($ exp , $ query ) {
1874
+ return $ exp ;
1875
+ }
1876
+ ]);
1877
+ $ query = $ articles ->find ('all ' )->contain (['Authors ' ]);
1878
+ $ result = $ query ->toArray ();
1879
+ $ this ->assertCount (4 , $ result );
1880
+ }
1881
+
1864
1882
/**
1865
1883
* Tests the formatResults method
1866
1884
*
You can’t perform that action at this time.
0 commit comments