/** * Test the getInput method. */ public function testGetInput() { $form = new JFormInspector('form1'); $this->assertThat( $form->load('<form><field name="helpsite" type="helpsite" /></form>'), $this->isTrue(), 'Line:'.__LINE__.' XML string should load successfully.' ); $field = new JFormFieldHelpsite($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. }
/** * Tests the getInput method. * * @return void * * @since 3.1 */ public function testGetInput() { $form = new JForm('form1'); $this->assertThat($form->load('<form><field name="helpsite" type="helpsite" label="Help Site" description="Help Site listing" /></form>'), $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.'); $field = new JFormFieldHelpsite($form); $this->assertThat($field->setup($form->getXml()->field, 'value'), $this->isTrue(), 'Line:' . __LINE__ . ' The setup method should return true.'); $this->assertContains('<option value="http://help.joomla.org/proxy/index.php?option=com_help&keyref=Help{major}{minor}:{keyref}">', $field->input, 'Line:' . __LINE__ . ' The getInput method should return an option with a link to the help site.'); }
/** * Tests the getInput method. * * @return void * * @since 3.1 */ public function testGetInput() { $field = new JFormFieldHelpsite(); $field->setup(new SimpleXMLElement('<field name="helpsite" type="helpsite" label="Help Site" description="Help Site listing" />'), 'value'); $this->assertContains('<option value="https://help.joomla.org/proxy?keyref=Help{major}{minor}:{keyref}&lang={langcode}">', $field->input, 'The getInput method should return an option with a link to the help site.'); }