private function assertMessagesJsonEquals(array $expectedMessages) { $messagesJson = CachingService::getMessagesJson(); $this->assertJson($messagesJson); $messages = json_decode($messagesJson, true); $this->assertEquals($expectedMessages, $messages); }
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); }