/** * Test the getInput method. * * @return void * * @since 12.1 */ public function testGetInput() { $form = new JFormInspector('form1'); $this->assertThat( $form->load('<form><field name="imagelist" type="imagelist" /></form>'), $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.' ); $field = new JFormFieldImageList($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.' ); // TODO: Should check all the attributes have come in properly. }
public function setup(SimpleXMLElement $element, $value, $group = null) { $return = parent::setup($element, $value, $group); if ($return) { $directory = JUDirectoryFrontHelper::getDirectory((string) $this->element['rel'], (string) $this->element['defaultRel']) . "default/"; $this->directory = $directory; } return $return; }