@@ -6685,6 +6685,62 @@ public function testFindAllArrayConditions() {
6685
6685
$ this ->assertEquals ($ expected , $ result );
6686
6686
}
6687
6687
6688
+ public function testFindAllI18nConditions () {
6689
+ $ this ->loadFixtures ('TranslateArticle ' , 'TranslatedArticle ' , 'User ' );
6690
+ $ TestModel = new TranslatedArticle ();
6691
+ $ TestModel ->cacheQueries = false ;
6692
+ $ TestModel ->locale = 'eng ' ;
6693
+ $ options = array (
6694
+ 'recursive ' => 0 ,
6695
+ 'conditions ' => array (
6696
+ 'NOT ' => array ('I18n__title.content ' => '' ),
6697
+ ),
6698
+ 'limit ' => 2 ,
6699
+ );
6700
+ $ result = $ TestModel ->find ('all ' , $ options );
6701
+ $ expected = array (
6702
+ array (
6703
+ 'TranslatedArticle ' => array (
6704
+ 'id ' => '1 ' ,
6705
+ 'user_id ' => '1 ' ,
6706
+ 'published ' => 'Y ' ,
6707
+ 'created ' => '2007-03-18 10:39:23 ' ,
6708
+ 'updated ' => '2007-03-18 10:41:31 ' ,
6709
+ 'locale ' => 'eng ' ,
6710
+ 'title ' => 'Title (eng) #1 ' ,
6711
+ 'body ' => 'Body (eng) #1 ' ,
6712
+ ),
6713
+ 'User ' => array (
6714
+ 'id ' => '1 ' ,
6715
+ 'user ' => 'mariano ' ,
6716
+ 'password ' => '5f4dcc3b5aa765d61d8327deb882cf99 ' ,
6717
+ 'created ' => '2007-03-17 01:16:23 ' ,
6718
+ 'updated ' => '2007-03-17 01:18:31 ' ,
6719
+ ),
6720
+ ),
6721
+ array (
6722
+ 'TranslatedArticle ' => array (
6723
+ 'id ' => '2 ' ,
6724
+ 'user_id ' => '3 ' ,
6725
+ 'published ' => 'Y ' ,
6726
+ 'created ' => '2007-03-18 10:41:23 ' ,
6727
+ 'updated ' => '2007-03-18 10:43:31 ' ,
6728
+ 'locale ' => 'eng ' ,
6729
+ 'title ' => 'Title (eng) #2 ' ,
6730
+ 'body ' => 'Body (eng) #2 ' ,
6731
+ ),
6732
+ 'User ' => array (
6733
+ 'id ' => '3 ' ,
6734
+ 'user ' => 'larry ' ,
6735
+ 'password ' => '5f4dcc3b5aa765d61d8327deb882cf99 ' ,
6736
+ 'created ' => '2007-03-17 01:20:23 ' ,
6737
+ 'updated ' => '2007-03-17 01:22:31 ' ,
6738
+ ),
6739
+ ),
6740
+ );
6741
+ $ this ->assertEquals ($ expected , $ result );
6742
+ }
6743
+
6688
6744
/**
6689
6745
* test find('list') method
6690
6746
*
@@ -7118,6 +7174,22 @@ public function testFindCount() {
7118
7174
$ this ->assertEquals ($ expected , $ result );
7119
7175
}
7120
7176
7177
+ public function testFindCountI18nConditions () {
7178
+ $ this ->loadFixtures ('TranslateArticle ' , 'TranslatedArticle ' , 'User ' );
7179
+ $ TestModel = new TranslatedArticle ();
7180
+ $ TestModel ->cacheQueries = false ;
7181
+ $ TestModel ->locale = 'eng ' ;
7182
+ $ options = array (
7183
+ 'recursive ' => 0 ,
7184
+ 'conditions ' => array (
7185
+ 'NOT ' => array ('I18n__title.content ' => '' ),
7186
+ ),
7187
+ 'limit ' => 2 ,
7188
+ );
7189
+ $ result = $ TestModel ->find ('count ' , $ options );
7190
+ $ this ->assertEquals (2 , $ result );
7191
+ }
7192
+
7121
7193
/**
7122
7194
* Test that find('first') does not use the id set to the object.
7123
7195
*
0 commit comments