コード例 #1
0
 private function assertMessagesJsonEquals(array $expectedMessages)
 {
     $messagesJson = CachingService::getMessagesJson();
     $this->assertJson($messagesJson);
     $messages = json_decode($messagesJson, true);
     $this->assertEquals($expectedMessages, $messages);
 }
コード例 #2
0
 public function createJsMessages()
 {
     $messages = CachingService::getMessagesJson();
     $messages = $this->ensureBackwardsCompatibility($messages);
     $contents = 'Lang.addMessages(' . $messages . ');';
     $contents .= 'Lang.setLocale("' . Lang::locale() . '");';
     $lastModified = new DateTime();
     $lastModified->setTimestamp(CachingService::getLastRefreshTimestamp());
     return Response::make($contents)->header('Content-Type', 'text/javascript')->setLastModified($lastModified);
 }