使用vfsStream,我能够要求或包含一个虚拟文件吗?包含或需要一个vfsStream文件
$structure = array(
'classes' => array('Foo.php' => '<?php class Foo {} ?>')
);
\vfsStream::create($structure);
require_once(\vfsStream::url('classes').DIRECTORY_SEPARATOR.'Foo.php');
上面的代码在PHPUnit下无提示失败。
谢谢。
https://bugs.php.net/bug.php?id=50898 –
我遇到同样的问题。 PHP文档说include/require接受流,所以看起来这应该起作用。我已经提交了一个[vfsStream错误报告](https://github.com/mikey179/vfsStream/issues/22) – Michael