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


PHP JFormInspector::loadFieldType方法代码示例

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


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

示例1: testLoadFieldType

 /**
  * Test the JForm::loadFieldType method.
  *
  * @return void
  */
 public function testLoadFieldType()
 {
     $inspector = new JFormInspector('test');
     $this->assertThat($inspector->loadFieldType('bogus'), $this->isFalse(), 'Line:' . __LINE__ . ' loadFieldType should return false if class not found.');
     $this->assertThat($inspector->loadFieldType('list') instanceof JFormFieldList, $this->isTrue(), 'Line:' . __LINE__ . ' loadFieldType should return the correct class.');
     // Add custom path.
     JForm::addFieldPath(__DIR__ . '/_testfields');
     $this->assertThat($inspector->loadFieldType('test') instanceof JFormFieldTest, $this->isTrue(), 'Line:' . __LINE__ . ' loadFieldType should return the correct custom class.');
     $this->assertThat($inspector->loadFieldType('foo.bar') instanceof FooFormFieldBar, $this->isTrue(), 'Line:' . __LINE__ . ' loadFieldType should return the correct custom class.');
     $this->assertThat($inspector->loadFieldType('modal_foo') instanceof JFormFieldModal_Foo, $this->isTrue(), 'Line:' . __LINE__ . ' loadFieldType should return the correct custom class.');
     $this->assertThat($inspector->loadFieldType('foo.modal_bar') instanceof FooFormFieldModal_Bar, $this->isTrue(), 'Line:' . __LINE__ . ' loadFieldType should return the correct custom class.');
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:17,代码来源:JFormTest.php

示例2: testLoadFieldType

 /**
  * Test the JForm::loadFieldType method.
  */
 public function testLoadFieldType()
 {
     $this->assertThat(JFormInspector::loadFieldType('bogus'), $this->isFalse(), 'Line:' . __LINE__ . ' loadFieldType should return false if class not found.');
     $this->assertThat(JFormInspector::loadFieldType('list') instanceof JFormFieldList, $this->isTrue(), 'Line:' . __LINE__ . ' loadFieldType should return the correct class.');
     // Add custom path.
     JForm::addFieldPath(dirname(__FILE__) . '/_testfields');
     $this->assertThat(JFormInspector::loadFieldType('test') instanceof JFormFieldTest, $this->isTrue(), 'Line:' . __LINE__ . ' loadFieldType should return the correct custom class.');
 }
开发者ID:Joomla-on-NoSQL,项目名称:LaMojo,代码行数:11,代码来源:JFormTest.php


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