示例#1
0
 /**
  * Test for JForm::removeField method.
  *
  * @return void
  */
 public function testRemoveField()
 {
     $form = new JFormInspector('form1');
     $this->assertThat($form->load(JFormDataHelper::$loadDocument), $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.');
     $this->assertThat($form->removeField('title'), $this->isTrue(), 'Line:' . __LINE__ . ' The removeField method should return true.');
     $this->assertThat($form->findField('title'), $this->isFalse(), 'Line:' . __LINE__ . ' The field should be removed.');
     $this->assertThat($form->removeField('show_title', 'params'), $this->isTrue(), 'Line:' . __LINE__ . ' The removeField method should return true.');
     $this->assertThat($form->findField('show_title', 'params'), $this->isFalse(), 'Line:' . __LINE__ . ' The field should be removed.');
 }