Zendframework(1.12.11)查看phpunit中找不到帮助程序

时间:2015-05-07 09:12:01

标签: zend-framework phpunit

我的zendframework项目中的视图助手有以下目录结构

 --application
       --views
         --helpers
            --Test.php

和application.ini中的配置设置是

resources.view.helperPath = APPLICATION_PATH "/views/helpers"

和Bootstrap.php中的配置是

$view->setHelperPath(APPLICATION_PATH . "/views/helpers/");
Test.php文件中的

命名约定是

class Zend_View_Helper_Test extends Zend_View_Helper_Abstract {}

我正在模块中使用帮助函数,无论我需要它。当我通过浏览器运行项目时,应用程序正常运行没有任何错误,但是当我通过命令行调用相同应用程序的phpunit时,我收到类似

Fatal error: Uncaught exception 'ErrorException' with message 'include_once(Zend\View\Helper\Test.php): failed to open stream: No such file or directory' in D:\
zend\ZendServer\share\ZendFramework-1.12.11\library\Zend\Loader.php:134

这意味着它将在zend服务器库视图文件夹中找到Test.php文件。我不知道为什么它通过浏览器工作而不能通过命令行在phpunit中工作。

1 个答案:

答案 0 :(得分:0)

I got solution. I have replace my configuration setting of application.ini

public class ArrayDivide {

public static void main(String[] args) {

    int arr1[]={8,4,6,8,4};
    int arr2[]={2,4,2,1,2};

    for (int x =0;x <arr1.length;x++){
            int result = arr1[x] / arr2[x]; 

            System.out.println(result);
     }

    }
}       

with

SELECT REPLACE(email, '.com', '.net') 
FROM emp

and changed naming convention of Test.php with

resources.view.helperPath = APPLICATION_PATH "/views/helpers"

now zend loder will try to find view helper in application directory rather than Zend