Пример #1
0
 /**
  * Test the JLanguage::parse method
  */
 public function testParse()
 {
     $lang = new JLanguageInspector('', true);
     $strings = $lang->parse(dirname(__FILE__) . '/_ini/bad.ini');
     $errors = $lang->getProperty('errorfiles');
     $this->assertThat(count($errors), $this->equalTo(1), 'Line: ' . __LINE__ . ' bad ini file should have one error.');
     // Slice the error string.
     $parts = explode('line(s)', array_pop($errors));
     $this->assertThat(trim($parts[1]), $this->equalTo('4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15'), 'Line: ' . __LINE__ . ' bad ini file should have several lines marked.');
 }
Пример #2
0
 /**
  * Allows the internal singleton to be set and mocked.
  *
  * @param   JLanguage  $instance  A language object.
  *
  * @return  void
  *
  * @since   11.3
  */
 public function setInstance($instance)
 {
     self::$instance = $instance;
 }