本文整理匯總了PHP中OX_Component::_getComponentsFiles方法的典型用法代碼示例。如果您正苦於以下問題:PHP OX_Component::_getComponentsFiles方法的具體用法?PHP OX_Component::_getComponentsFiles怎麽用?PHP OX_Component::_getComponentsFiles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OX_Component
的用法示例。
在下文中一共展示了OX_Component::_getComponentsFiles方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test_getComponentFilesFromDirectory
function test_getComponentFilesFromDirectory()
{
$GLOBALS['_MAX']['CONF']['pluginPaths']['plugins'] = '/lib/OX/Plugin/tests/data/testExtensions/';
$GLOBALS['_MAX']['CONF']['pluginGroupComponents'] = array('testGroup1' => 1, 'testGroup2' => 1);
$extension = 'testExtension1';
$group = 'testGroup1';
$recursive = 0;
$aResult = OX_Component::_getComponentsFiles($extension, $group, $recursive);
$this->assertEqual(count($aResult), 1);
$this->assertTrue(isset($aResult['testGroup1']));
$this->assertEqual(count($aResult['testGroup1']), 2);
$this->assertEqual($aResult['testGroup1'][0], 'testComponent1.class.php');
$this->assertEqual($aResult['testGroup1'][1], 'testComponent2.class.php');
$extension = 'testExtension1';
$group = 'testGroup1';
$recursive = 1;
$aResult = OX_Component::_getComponentsFiles($extension, $group, $recursive);
$this->assertEqual(count($aResult), 1);
$this->assertTrue(isset($aResult['testGroup1']));
$this->assertEqual(count($aResult['testGroup1']), 2);
$this->assertEqual($aResult['testGroup1'][0], 'testComponent1.class.php');
$this->assertEqual($aResult['testGroup1'][1], 'testComponent2.class.php');
$extension = 'testExtension1';
$group = 'testGroup2';
$recursive = 0;
$aResult = OX_Component::_getComponentsFiles($extension, $group, $recursive);
$this->assertEqual(count($aResult), 1);
$this->assertTrue(isset($aResult['testGroup2']));
$this->assertEqual(count($aResult['testGroup2']), 2);
$this->assertEqual($aResult['testGroup2'][0], 'testComponent1.class.php');
$this->assertEqual($aResult['testGroup2'][1], 'testComponent2.class.php');
$extension = 'testExtension1';
$group = 'testGroup2';
$recursive = 1;
$aResult = OX_Component::_getComponentsFiles($extension, $group, $recursive);
$this->assertEqual(count($aResult), 1);
$this->assertTrue(isset($aResult['testGroup2']));
$this->assertEqual(count($aResult['testGroup2']), 3);
$this->assertEqual($aResult['testGroup2'][0], 'testComponent1.class.php');
$this->assertEqual($aResult['testGroup2'][1], 'testComponent2.class.php');
$this->assertEqual($aResult['testGroup2'][2], 'testComponent3.class.php');
}