Пример #1
0
 /**
  * Test for JForm::loadField method.
  *
  * @return void
  */
 public function testLoadField()
 {
     $form = new JFormInspector('form1');
     $this->assertThat($form->load(JFormDataHelper::$loadFieldDocument), $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.');
     // Error handling.
     $this->assertThat($form->loadField('bogus'), $this->isFalse(), 'Line:' . __LINE__ . ' An unknown field should return false.');
     // Test correct usage.
     $field = $form->getField('title');
     $field = $form->loadField($field);
 }