@@ -207,11 +207,15 @@ public function testGetCatalogueBehavesConsistently()
207
207
208
208
$ translator ->addLoader ('array ' , new ArrayLoader ());
209
209
$ translator ->addResource ('array ' , array ('foo ' => 'foo (a) ' ), 'a ' );
210
+ $ translator ->addResource ('array ' , array ('foo ' => 'foo (b) ' ), 'b ' );
210
211
$ translator ->addResource ('array ' , array ('bar ' => 'bar (b) ' ), 'b ' );
211
212
212
213
$ catalogue = $ translator ->getCatalogue ('a ' );
213
214
$ this ->assertFalse ($ catalogue ->defines ('bar ' )); // Sure, the "a" catalogue does not contain that message.
214
215
216
+ $ fallback = $ catalogue ->getFallbackCatalogue ();
217
+ $ this ->assertTrue ($ fallback ->defines ('foo ' )); // "foo" is present in "a" and "b"
218
+
215
219
/*
216
220
* Now, repeat the same test.
217
221
* Behind the scenes, the cache is used. But that should not matter, right?
@@ -221,10 +225,14 @@ public function testGetCatalogueBehavesConsistently()
221
225
222
226
$ translator ->addLoader ('array ' , new ArrayLoader ());
223
227
$ translator ->addResource ('array ' , array ('foo ' => 'foo (a) ' ), 'a ' );
228
+ $ translator ->addResource ('array ' , array ('foo ' => 'foo (b) ' ), 'b ' );
224
229
$ translator ->addResource ('array ' , array ('bar ' => 'bar (b) ' ), 'b ' );
225
230
226
231
$ catalogue = $ translator ->getCatalogue ('a ' );
227
232
$ this ->assertFalse ($ catalogue ->defines ('bar ' ));
233
+
234
+ $ fallback = $ catalogue ->getFallbackCatalogue ();
235
+ $ this ->assertTrue ($ fallback ->defines ('foo ' ));
228
236
}
229
237
230
238
protected function getCatalogue ($ locale , $ messages )
0 commit comments