• 在phpnow中配置phpunit


    前面都好了之后,在 D:phpnowphp-5.2.14-Win32PEAR 之外的地方执行 phpinfo 都会出现以下错误

    Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such
    file or directory in D:RobinProgramesphp-5.3.1-Win32-VC6-x86PEARPHPUnitAutoload.php on line 45

    在这里 http://www.cnblogs.com/dycsoft/archive/2013/04/02/2995083.html 找到解决方法。

    具体到phpnow里,php.exe的缺省ini文件指向 c:windowsphp.ini,但那里并没有。在 D:phpnowphp-5.2.14-Win32 下找到 php.ini-dist 改名为 php.ini,再次运行 php.exe 则会发现,ini文件已经指向这个文件了。看来是php.exe先在当前文件夹中寻找php.ini,如果找不到,则到 c:windows下查找。如果都没有,则采用默认值。

    修改 php.ini:

    include_path = ".;c:phpincludes;D:phpnowphp-5.2.14-Win32PEAR"

    做完以上工作,随便找个路径下运行phpunit,都出现了正确的结果。

    ==================================================

    以下测试在yii下的test:

    D:>cd D:phpnowhtdocsxxexamprotected ests

    D:phpnowhtdocsxxexamprotected ests>phpunit unitsBBCodeTest.php

    Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to open s
    tream: No such file or directory in D:phpnowhtdocsyii-1.1.14.f0fee9framework
    estCWebTestCase.php on line 12

    Fatal error: require_once(): Failed opening required 'PHPUnit/Extensions/Seleniu
    mTestCase.php' (include_path='.;c:phpincludes;D:phpnowphp-5.2.14-Win32PEAR'
    ) in D:phpnowhtdocsyii-1.1.14.f0fee9framework estCWebTestCase.php on line
    12

    不明所以。上网查了之后(http://www.yiiframework.com/forum/index.php/topic/16553-cant-get-phpunit-and-selenium-working-correctly/

    明白了原来是yii使用了phpunit的Selenium扩展,而pear默认安装不包括它。按该贴子的某人建议,去 http://pear.phpunit.de/ 下载 PHPUnit_Selenium 并把相应文件夹拷贝到phpunit的extension文件夹下。再次运行 phpunit unitsa.php ,oh no! what's the fuck!

    D:phpnowhtdocsxxexamprotected ests>phpunit unitsBBCodeTest.php

    Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in D:phpnowphp
    -5.2.14-Win32PEARPHPUnitExtensionsSeleniumCommonAutoload.php on line 48

    这里居然出现了语法错误。实在不知如何继续。先放一放。。。

  • 相关阅读:
    Unique Paths II
    Search Insert Position
    Remove Duplicates from Sorted Array
    Swap Nodes in Pairs
    Merge Two Sorted Lists
    下载youtube 视频工具
    CloudSTack4.2 查看所有虚拟机API测试
    实现业务系统中的用户权限管理--实现篇
    实现业务系统中的用户权限管理--设计篇
    CloudStack4.2 更新全局参数
  • 原文地址:https://www.cnblogs.com/anjo/p/3468541.html
Copyright © 2020-2023  润新知