Révision 6f57d8c7
Ajouté par Assos Assos il y a environ 9 ans
drupal7/sites/all/modules/views/tests/views_module.test | ||
---|---|---|
194 | 194 |
$this->assertEqual(variable_get('views_test_views_data_count', 0), 1, 'Views data rebuilt once'); |
195 | 195 |
$this->assertFalse(drupal_static('_views_fetch_data_fully_loaded'), 'Views data is not fully loaded'); |
196 | 196 |
|
197 |
|
|
198 |
// Test if the cache consistency is ensured. There was an issue where |
|
199 |
// calling _views_fetch_data() first with a table would prevent the function |
|
200 |
// from properly rebuilt a missing the general cache entry. |
|
201 |
// See https://www.drupal.org/node/2475669 for details. |
|
202 |
// Make sure we start with a empty cache. |
|
203 |
$this->resetStaticViewsDataCache(); |
|
204 |
cache_clear_all('*', 'cache_views', TRUE); |
|
205 |
|
|
206 |
// Prime the static cache of _views_fetch_data() by calling it with a table |
|
207 |
// first. |
|
208 |
views_fetch_data('views_test'); |
|
209 |
// Now remove the general cache. |
|
210 |
cache_clear_all('views_data:en', 'cache_views'); |
|
211 |
// Reset the static cache to see if fetches from the persistent cache |
|
212 |
// properly rebuild the static cache. |
|
213 |
$this->resetStaticViewsDataCache(); |
|
214 |
// Prime the static cache of _views_fetch_data() by calling it with a table |
|
215 |
// first. |
|
216 |
views_fetch_data('views_test'); |
|
217 |
// Fetch the general cache, which was deleted, an see if it is rebuild |
|
218 |
// properly. |
|
219 |
views_fetch_data(); |
|
220 |
$this->assertTrue(cache_get('views_data:en', 'cache_views'), 'Cache for all tables was properly rebuild.'); |
|
197 | 221 |
} |
198 | 222 |
|
199 | 223 |
/** |
Formats disponibles : Unified diff
Weekly update of contrib modules