getLanguageList() public method

Return an indexed list of all languages available.
public getLanguageList ( ) : array
return array An array holding all the languages available as the keys of the array. The value for each key is true in case that the language specified by that key is currently active, or false otherwise.
Ejemplo n.º 1
0
 /**
  * Test SimpleSAML\Locale\Language::getLanguageList().
  */
 public function testGetLanguageListIncorrectConfig()
 {
     // test non-existent langs
     $c = \SimpleSAML_Configuration::loadFromArray(array('language.available' => array('foo', 'bar')), '', 'simplesaml');
     $l = new Language($c);
     $l->setLanguage('foo');
     $this->assertEquals(array('en' => true), $l->getLanguageList());
 }
Ejemplo n.º 2
0
 /**
  * Test SimpleSAML\Locale\Language::getLanguageList().
  */
 public function testGetLanguageList()
 {
     // test defaults
     $c = \SimpleSAML_Configuration::loadFromArray(array(), '', 'simplesaml');
     $l = new Language($c);
     $l->setLanguage('en');
     $this->assertEquals(array('en' => true), $l->getLanguageList());
     // test non-defaults
     $c = \SimpleSAML_Configuration::loadFromArray(array('language.available' => array('xx', 'yy', 'zz')), '', 'simplesaml');
     $l = new Language($c);
     $l->setLanguage('yy');
     $this->assertEquals(array('xx' => false, 'yy' => true, 'zz' => false), $l->getLanguageList());
 }