예제 #1
0
 /**
  * Load the translations form the session
  *
  * @param string $key
  * @return Translations
  */
 public function load($key = self::DEFAULT_KEY)
 {
     $rawTranslations = $this->session->get($key);
     $translations = new Translations();
     $translations->setRawData($rawTranslations);
     return $translations;
 }
 /**
  * Basic test of set raw data
  */
 public function testSetRawDataWithValidDataEndsProperly()
 {
     // Test data
     $data = array('bundles' => array(), 'domains' => array(), 'locales' => array(), 'files' => array(), 'messages' => array());
     // Run the test
     $translations = new Translations();
     $translations->setRawData($data);
     // Assertions
     $result = $translations->getRawData();
     $this->assertEquals($data, $result);
 }