/** * Test the getInput method. */ public function testGetInput() { $form = new JFormInspector('form1'); $this->assertThat( $form->load('<form><field name="category" type="category" /></form>'), $this->isTrue(), 'Line:'.__LINE__.' XML string should load successfully.' ); $field = new JFormFieldCategory($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. }
/** * Test the getInput method. * * @since 11.1 * @todo Should check all the attributes have come in properly. * * @return void */ public function testGetInput() { $form = new JFormInspector('form1'); $this->assertThat($form->load('<form><field name="category" type="category" /></form>'), $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.'); $field = new JFormFieldCategory($form); $this->assertThat($field->setup($form->getXml()->field, 'value'), $this->isTrue(), 'Line:' . __LINE__ . ' The setup method should return true.'); $this->assertThat(strlen($field->input), $this->greaterThan(0), 'Line:' . __LINE__ . ' The getInput method should return something without error.'); }
public function __get($name) { switch ($name) { case 'element': return $this->{$name}; break; } $value = parent::__get($name); return $value; }
/** * Method to get the field input markup for a generic list. * Use the multiple attribute to enable multiselect. * * @return string The field input markup. * * @since 11.1 */ protected function getInput() { $plugin = JPATH_ADMINISTRATOR . '/components/com_akquickicons/includes/plugins/pro/pro.php'; if (JFile::exists($plugin)) { $this->multiple = true; } else { $this->multiple = false; } return parent::getInput(); }
protected function getInput() { $options = (array) $this->getOptions(); if (empty($options)) { $formfield = JFormHelper::loadFieldType('text'); $formfield->setup($this->element, ''); if (is_array($this->value)) { $formfield->value = implode(',', $this->value); } else { $formfield->value = $this->value; } $formfield->hint = JText::_((string) $this->hint); return $formfield->getInput() . PHP_EOL; } return parent::getInput(); }
/** * Method to get the field input markup for a generic list. * Use the multiple attribute to enable multiselect. * * @return string The field input markup. */ protected function getInput() { return parent::getInput() . $this->quickadd(); }
/** * Test the getInput method. */ public function testGetInput() { $field = new JFormFieldCategory(); $field->setup(new SimpleXmlElement('<field name="category" type="category" extension="com_content" />'), 'value'); $this->assertNotEmpty($field->input); }