现在的位置: 首页 > 综合 > 正文

php如何在运行phpunit之前修改一些必要的环境变量

2014年03月27日 ⁄ 综合 ⁄ 共 356字 ⁄ 字号 评论关闭

1 最直接的方法,修改phpunit,当然也可以cp出来一份s-phpunit,将必要的环境变量的设置如set_include_path,require,或者autorload等的机制放到s-phpunit进行加载。运行的时候使用s-phpunit *.php就可以了。

 

2 使用test suite这个机制,将必要的配置放到AllTest.php文件中, 比如require_once的一些东西,并且在xml配置中是AllTest.php先运行,那么将运行时候使用phpunit 文件夹名字,那么就可以运行文件夹中的所有文件了。

 

链接如下:http://www.phpunit.de/manual/current/en/organizing-tests.html#organizing-tests.filesystem

 

3

抱歉!评论已关闭.