@@ -74,41 +74,6 @@ public function testThatACacheIsUsed($debug)
74
74
$ this ->assertEquals ('OK ' , $ translator ->trans ($ msgid ), '-> caching does not work in ' .($ debug ? 'debug ' : 'production ' ));
75
75
}
76
76
77
- public function testRefreshCacheWhenResourcesChange ()
78
- {
79
- // prime the cache
80
- $ loader = $ this ->getMock ('Symfony\Component\Translation\Loader\LoaderInterface ' );
81
- $ loader
82
- ->method ('load ' )
83
- ->will ($ this ->returnValue ($ this ->getCatalogue ('fr ' , array (
84
- 'foo ' => 'foo A ' ,
85
- ))))
86
- ;
87
-
88
- $ translator = new Translator ('fr ' , null , $ this ->tmpDir , true );
89
- $ translator ->setLocale ('fr ' );
90
- $ translator ->addLoader ('loader ' , $ loader );
91
- $ translator ->addResource ('loader ' , 'foo ' , 'fr ' );
92
-
93
- $ this ->assertEquals ('foo A ' , $ translator ->trans ('foo ' ));
94
-
95
- // add a new resource to refresh the cache
96
- $ loader = $ this ->getMock ('Symfony\Component\Translation\Loader\LoaderInterface ' );
97
- $ loader
98
- ->method ('load ' )
99
- ->will ($ this ->returnValue ($ this ->getCatalogue ('fr ' , array (
100
- 'foo ' => 'foo B ' ,
101
- ))))
102
- ;
103
-
104
- $ translator = new Translator ('fr ' , null , $ this ->tmpDir , true );
105
- $ translator ->setLocale ('fr ' );
106
- $ translator ->addLoader ('loader ' , $ loader );
107
- $ translator ->addResource ('loader ' , 'bar ' , 'fr ' );
108
-
109
- $ this ->assertEquals ('foo B ' , $ translator ->trans ('foo ' ));
110
- }
111
-
112
77
public function testCatalogueIsReloadedWhenResourcesAreNoLongerFresh ()
113
78
{
114
79
/*
@@ -150,32 +115,6 @@ public function testCatalogueIsReloadedWhenResourcesAreNoLongerFresh()
150
115
$ translator ->trans ($ msgid );
151
116
}
152
117
153
- /**
154
- * @dataProvider runForDebugAndProduction
155
- */
156
- public function testDifferentTranslatorsForSameLocaleDoNotInterfere ($ debug )
157
- {
158
- $ locale = 'any_locale ' ;
159
- $ format = 'some_format ' ;
160
- $ msgid = 'test ' ;
161
-
162
- // Create a Translator and prime its cache
163
- $ translator = new Translator ($ locale , null , $ this ->tmpDir , $ debug );
164
- $ translator ->addLoader ($ format , new ArrayLoader ());
165
- $ translator ->addResource ($ format , array ($ msgid => 'FAIL ' ), $ locale );
166
- $ translator ->trans ($ msgid );
167
-
168
- /*
169
- * Create another Translator with the same locale but a different resource.
170
- * It should not use the first translator's cache but return the value from its own resource.
171
- */
172
- $ translator = new Translator ($ locale , null , $ this ->tmpDir , $ debug );
173
- $ translator ->addLoader ($ format , new ArrayLoader ());
174
- $ translator ->addResource ($ format , array ($ msgid => 'OK ' ), $ locale );
175
-
176
- $ this ->assertEquals ('OK ' , $ translator ->trans ($ msgid ), '-> different translators for the same domain interfere in ' .($ debug ? 'debug ' : 'production ' ));
177
- }
178
-
179
118
/**
180
119
* @dataProvider runForDebugAndProduction
181
120
*/
0 commit comments