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


PHP JFormInspector::loadRuleType方法代码示例

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


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

示例1: testLoadRuleType

 /**
  * Test for JForm::loadRuleType method.
  *
  * @return void
  */
 public function testLoadRuleType()
 {
     $form = new JFormInspector('form1');
     // Test error handling.
     $this->assertThat($form->loadRuleType('bogus'), $this->isFalse(), 'Line:' . __LINE__ . ' Loading an unknown rule should return false.');
     // Test loading a custom rule.
     JForm::addRulePath(__DIR__ . '/_testrules');
     $this->assertThat($form->loadRuleType('custom') instanceof JFormRule, $this->isTrue(), 'Line:' . __LINE__ . ' Loading a known rule should return a rule object.');
     // Test all the stock rules load.
     $this->assertThat($form->loadRuleType('boolean') instanceof JFormRule, $this->isTrue(), 'Line:' . __LINE__ . ' Loading the boolean rule should return a rule object.');
     $this->assertThat($form->loadRuleType('email') instanceof JFormRule, $this->isTrue(), 'Line:' . __LINE__ . ' Loading the email rule should return a rule object.');
     $this->assertThat($form->loadRuleType('equals') instanceof JFormRule, $this->isTrue(), 'Line:' . __LINE__ . ' Loading the equals rule should return a rule object.');
     $this->assertThat($form->loadRuleType('rules') instanceof JFormRule, $this->isTrue(), 'Line:' . __LINE__ . ' Loading the [access control] rules rule should return a rule object.');
     $this->assertThat($form->loadRuleType('username') instanceof JFormRule, $this->isTrue(), 'Line:' . __LINE__ . ' Loading the username rule should return a rule object.');
     $this->assertThat($form->loadRuleType('options') instanceof JFormRule, $this->isTrue(), 'Line:' . __LINE__ . ' Loading the options rule should return a rule object.');
     $this->assertThat($form->loadRuleType('color') instanceof JFormRule, $this->isTrue(), 'Line:' . __LINE__ . ' Loading the color rule should return a rule object.');
     $this->assertThat($form->loadRuleType('tel') instanceof JFormRule, $this->isTrue(), 'Line:' . __LINE__ . ' Loading the tel rule should return a rule object.');
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:23,代码来源:JFormTest.php


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