コード例 #1
0
	/**
	 * 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.
	}
コード例 #2
0
 /**
  * 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&amp;keyref=Help{major}{minor}:{keyref}">', $field->input, 'Line:' . __LINE__ . ' The getInput method should return an option with a link to the help site.');
 }
コード例 #3
0
 /**
  * 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}&amp;lang={langcode}">', $field->input, 'The getInput method should return an option with a link to the help site.');
 }