public function testGetLastRefreshTimestamp() { $timestamp = CachingService::getLastRefreshTimestamp(); $this->assertEquals(0, $timestamp); CachingService::refreshMessageCache(); $refreshTime = time(); $timestamp = CachingService::getLastRefreshTimestamp(); $this->assertEquals($refreshTime, $timestamp); }
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); }