解决方法
它们应该可用.但是,PHPUnit在测试之间备份全局状态:
By default,PHPUnit runs your tests in a way where changes to global and super-global variables ($GLOBALS,$_ENV,$_POST,$_GET,$_COOKIE,$_SERVER,$_FILES,$_REQUEST) do not affect other tests. Optionally,this isolation can be extended to static attributes of classes.
所以这可能是一个问题.另请注意
Objects of some classes that are provided by PHP itself,such as PDO for example,cannot be serialized and the backup operation will break when such an object is stored in the $GLOBALS array,for instance.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。