/**
	 * Test the getInput method.
	 */
	public function testGetInput()
	{
		$form = new JFormInspector('form1');

		$this->assertThat(
			$form->load('<form><field name="language" type="language" /></form>'),
			$this->isTrue(),
			'Line:'.__LINE__.' XML string should load successfully.'
		);

		$field = new JFormFieldLanguage($form);

		$this->assertThat(
			$field->setup($form->getXml()->field, 'value'),
			$this->isTrue(),
			'Line:'.__LINE__.' The setup method should return true.'
		);

		$this->markTestIncomplete('Problems encountered in next assertion');

		$this->assertThat(
			strlen($field->input),
			$this->greaterThan(0),
			'Line:'.__LINE__.' The getInput method should return something without error.'
		);

		// TODO: Should check all the attributes have come in properly.
	}
 /**
  * Method to get the field options.
  *
  * @since 2.0
  *
  * @return  array  The field option objects.
  */
 protected function getOptions()
 {
     $options = parent::getOptions();
     $noneoption = $this->element['none'] ? $this->element['none'] : null;
     if ($noneoption) {
         array_unshift($options, JHtml::_('select.option', '*', JText::_($noneoption)));
     }
     return $options;
 }
Beispiel #3
0
 /**
  * Method to get the field options.
  *
  * @since 2.0
  *
  * @return  array  The field option objects.
  */
 protected function getOptions()
 {
     $client = (string) $this->element['client'];
     if ($client != 'site' && $client != 'administrator') {
         $client = 'site';
     }
     if (!isset(static::$cachedOptions[$client])) {
         static::$cachedOptions[$client] = parent::getOptions();
     }
     $options = array_merge(static::$cachedOptions[$client]);
     $noneoption = $this->element['none'] ? $this->element['none'] : null;
     if ($noneoption) {
         array_unshift($options, JHtml::_('select.option', '*', JText::_($noneoption)));
     }
     return $options;
 }