当前位置: 首页>>代码示例>>PHP>>正文


PHP JFormInspector::getFieldsets方法代码示例

本文整理汇总了PHP中JFormInspector::getFieldsets方法的典型用法代码示例。如果您正苦于以下问题:PHP JFormInspector::getFieldsets方法的具体用法?PHP JFormInspector::getFieldsets怎么用?PHP JFormInspector::getFieldsets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JFormInspector的用法示例。


在下文中一共展示了JFormInspector::getFieldsets方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetFieldsets

 /**
  * Test for JForm::getFieldsets method.
  *
  * @return void
  */
 public function testGetFieldsets()
 {
     // Prepare the form.
     $form = new JFormInspector('form1');
     $this->assertThat($form->load(JFormDataHelper::$getFieldsetsDocument), $this->isTrue(), 'Line:' . __LINE__ . ' XML string should load successfully.');
     $sets = $form->getFieldsets();
     $this->assertThat(count($sets), $this->equalTo(3), 'Line:' . __LINE__ . ' The source data has 3 fieldsets in total.');
     $this->assertThat($sets['params-advanced']->name, $this->equalTo('params-advanced'), 'Line:' . __LINE__ . ' Ensure the fieldset name is correct.');
     $this->assertThat($sets['params-advanced']->label, $this->equalTo('Advanced Options'), 'Line:' . __LINE__ . ' Ensure the fieldset label is correct.');
     $this->assertThat($sets['params-advanced']->description, $this->equalTo('The advanced options'), 'Line:' . __LINE__ . ' Ensure the fieldset description is correct.');
     // Test loading by group.
     $this->assertThat($form->getFieldsets('bogus'), $this->equalTo(array()), 'Line:' . __LINE__ . ' A fieldset that in a group that does not exist should return an empty array.');
     $sets = $form->getFieldsets('details');
     $this->assertThat(count($sets), $this->equalTo(1), 'Line:' . __LINE__ . ' The details group has one field marked with a fieldset');
     $this->assertThat($sets['params-legacy']->name, $this->equalTo('params-legacy'), 'Line:' . __LINE__ . ' Ensure the fieldset name is correct.');
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:21,代码来源:JFormTest.php


注:本文中的JFormInspector::getFieldsets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。