當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OX_Component::callStaticMethod方法代碼示例

本文整理匯總了PHP中OX_Component::callStaticMethod方法的典型用法代碼示例。如果您正苦於以下問題:PHP OX_Component::callStaticMethod方法的具體用法?PHP OX_Component::callStaticMethod怎麽用?PHP OX_Component::callStaticMethod使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OX_Component的用法示例。


在下文中一共展示了OX_Component::callStaticMethod方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_callStaticMethod

 function test_callStaticMethod()
 {
     $this->assertEqual(OX_Component::callStaticMethod('testExtension1', 'testGroup1', 'testComponent1', 'staticMethod'), 'staticMethodResult1');
     $this->assertEqual(OX_Component::callStaticMethod('testExtension1', 'testGroup1', 'testComponent1', 'staticMethodWithParams', 'foo'), 'staticMethodWithParams1=foo');
 }
開發者ID:Jaree,項目名稱:revive-adserver,代碼行數:5,代碼來源:Component.plg.test.php

示例2: testCallStaticMethod

 /**
  * A method to test the callStaticMethod() method.
  */
 function testCallStaticMethod()
 {
     // Set the error handling class' handleErrors() method as
     // the error handler for PHP for this test.
     $oTestErrorHandler = new TestErrorHandler();
     PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, array(&$oTestErrorHandler, 'handleErrors'));
     // Test with a bad module/package
     $return = MAX_Plugin::callStaticMethod('foo', 'bar', null, 'foo');
     $this->assertEqual(count($oTestErrorHandler->aErrors), 1);
     $this->assertEqual($oTestErrorHandler->aErrors[0]->message, 'Unable to include the file ' . MAX_PATH . '/plugins/foo/bar/bar' . MAX_PLUGINS_EXTENSION . '.');
     $this->assertFalse($result);
     $oTestErrorHandler->reset();
     // Unset the error handler
     PEAR::popErrorHandling();
     // Set the error handling class' handleErrors() method as
     // the error handler for PHP for this test.
     $oTestErrorHandler = new TestErrorHandler();
     PEAR::pushErrorHandling(PEAR_ERROR_CALLBACK, array(&$oTestErrorHandler, 'handleErrors'));
     // Test with a bad method
     $return = MAX_Plugin::callStaticMethod('reports', 'standard', 'advertisingAnalysisReport', 'foo');
     $this->assertEqual(count($oTestErrorHandler->aErrors), 1);
     $this->assertEqual($oTestErrorHandler->aErrors[0]->message, "Method 'foo()' not defined in class 'Plugins_Reports_Standard_AdvertisingAnalysisReport'.");
     $this->assertFalse($result);
     $oTestErrorHandler->reset();
     // Unset the error handler
     PEAR::popErrorHandling();
     unset($GLOBALS['_MAX']['CONF']['plugins']['openXTests']);
     unset($GLOBALS['_MAX']['CONF']['pluginGroupComponents']['Dummy']);
     TestEnv::installPluginPackage('openXTests');
     // Test with a real method, no parameters
     $return = OX_Component::callStaticMethod('deliveryLimitations', 'Dummy', 'Dummy', 'isAllowed');
     $this->assertTrue($return);
     // Test with a real method, with parameters
     $return = OX_Component::callStaticMethod('deliveryLimitations', 'Dummy', 'Dummy', 'isAllowed', 'disallow');
     $this->assertFalse($return);
     TestEnv::uninstallPluginPackage('openXTests');
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:40,代碼來源:Plugin.plg_old_test.php


注:本文中的OX_Component::callStaticMethod方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。