/** * Tests the Form::findFieldsByFieldset method. * * @return void */ public function testFindFieldsByFieldset() { // Prepare the form. $form = new JFormInspector('form1'); $this->assertThat($form->load(JFormDataHelper::$findFieldsByFieldsetDocument), $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.'); // Error handling. $this->assertThat($form->findFieldsByFieldset('bogus'), $this->equalTo(array()), 'Line:' . __LINE__ . ' An unknown fieldset should return an empty array.'); // Test regular usage. $this->assertThat(count($form->findFieldsByFieldset('params-basic')), $this->equalTo(3), 'Line:' . __LINE__ . ' The params-basic fieldset has 3 fields.'); $this->assertThat(count($form->findFieldsByFieldset('params-advanced')), $this->equalTo(2), 'Line:' . __LINE__ . ' The params-advanced fieldset has 2 fields.'); }