Example #1
0
 /**
  * Method to attach a Form object to the field.
  *
  * @param   Form  $form  The Form object to attach to the form field.
  *
  * @return  Field  The form field object so that the method can be used in a chain.
  *
  * @since   1.0
  */
 public function setForm(Form $form)
 {
     $this->form = $form;
     $this->formControl = $form->getFormControl();
     return $this;
 }
 /**
  * Test the Form::getFormControl method.
  *
  * @return void
  */
 public function testGetFormControl()
 {
     $form = new Form('form8ion');
     $this->assertThat($form->getFormControl(), $this->equalTo(''), 'Line:' . __LINE__ . ' A form control that has not been specified should return nothing.');
     $form = new Form('form8ion', array('control' => 'jform'));
     $this->assertThat($form->getFormControl(), $this->equalTo('jform'), 'Line:' . __LINE__ . ' The form control should agree with the options passed in the constructor.');
 }