使用PHP中的SimpleTest进行单元测试,是否不断从相对路径获取文件目录错误? [英] Unit Testing With SimpleTest in PHP keeping getting file directory errors from relative paths?

查看:91
本文介绍了使用PHP中的SimpleTest进行单元测试,是否不断从相对路径获取文件目录错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Zend Framework MVC并通过SimpleTest库进行单元测试.我有一个特定的模型,它会一直失败,因为它使用Zend Cache,并且缓存目录是一个相对路径,我想知道是否有人看到过类似b4的问题.谢谢.

I am using Zend Framework MVC and unit-testing with SimpleTest library. I have a specific model that keeps failing because it uses Zend Cache and the cache directory is a relative path I was wondering if anyone has seen a problem like this b4. Thanks.

推荐答案

无论我使用哪种文件结构,我都必须使用$ _SERVER ['DOCUMENT_ROOT']来建立绝对路径.真正的相对路径.大声笑.

I had to make an absolute path using $_SERVER['DOCUMENT_ROOT'] that way no matter what file structure I am on it works. a Truly relative path. lol.

这篇关于使用PHP中的SimpleTest进行单元测试,是否不断从相对路径获取文件目录错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆