Skip to content

Commit 3c9b414

Browse files
committed
[Translation] avoid freshness check based on content *inside* the cache.
1 parent 8e1f3cf commit 3c9b414

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Tests/Translation/TranslatorTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,17 @@ public function testWarmup()
255255
__DIR__.'/../Fixtures/Resources/translations/messages.fr.yml',
256256
),
257257
);
258+
$catalogueHash = sha1(serialize(array(
259+
'resources' => array(),
260+
'fallback_locales' => array(),
261+
)));
258262

259263
// prime the cache
260-
$translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir, 'resource_files' => $resourceFiles), 'yml');
261-
$this->assertFalse(file_exists($this->tmpDir.'/catalogue.fr.php'));
264+
$translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir, 'resource_files' => $resourceFiles), 'yml');
265+
266+
$this->assertFalse(file_exists($this->tmpDir.'/catalogue.fr.'.$catalogueHash.'.php'));
262267
$translator->warmup($this->tmpDir);
263-
$this->assertTrue(file_exists($this->tmpDir.'/catalogue.fr.php'));
268+
$this->assertTrue(file_exists($this->tmpDir.'/catalogue.fr.'.$catalogueHash.'.php'));
264269
}
265270
}
266271

0 commit comments

Comments
 (0)