- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经设置了一个 vfsstream block 设备,我正在尝试对其调用 file_get_contents()
。然而,对 vfsStreamWrapper::stream_open
的调用失败,因此无法打开流。
这是我的代码:
$this->root = vfsStream::setup('root');
$this->root->addChild(new vfsStreamBlock('test_block_device'));
$this->root->addChild(new vfsStreamFile('not_block_device'));
echo file_get_contents('vfs://root/test_block_device/size');
这里是错误:
file_get_contents(vfs://root/test_block_device/size): failed to open stream: "org\bovigo\vfs\vfsStreamWrapper::stream_open" call failed
Here is the closest issue I've found on this
然而,他的问题是 phpunit 的拆卸问题,而我的问题发生在测试中期。
最佳答案
从文档来看,您似乎需要在读取 block 设备之前向 block 设备添加一些内容:https://github.com/mikey179/vfsStream/wiki/BlockDevices
关于php - vfsstream : file_get_contents() failed to open stream: stream_open call failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28301884/
我正在尝试使用 vfsStream 对文件系统交互进行单元测试,但很快就遇到了一个主要障碍。被测代码执行的验证检查之一是在提供的输入路径上执行 realpath() 以测试它是实际路径而不是废话。但是
我正在尝试使用 vfsStream 模拟文件系统操作(实际上是从 php://input 中读取),但缺乏合适的文档和示例确实阻碍了我。 我正在测试的类的相关代码如下: class RequestBo
使用 vfsStream,我可以要求或包含一个虚拟文件吗? $structure = array( 'classes' => array('Foo.php' => '') ); \vfsStr
vfsStream 的用例如下: $directories = explode('/', 'path/to/some/dir'); $structure = []; $reference =& $st
我尝试使用 PHPUnit 和 vfsStream 测试 move_uploaded_file 和 is_uploaded_file。他们总是返回错误。 public function testSho
我正在使用 Amazon LightSail 和 CodeIgniter 框架。尝试安装 PhpSpreadsheet - https://phpspreadsheet.readthedocs.io/
我已经设置了一个 vfsstream block 设备,我正在尝试对其调用 file_get_contents()。然而,对 vfsStreamWrapper::stream_open 的调用失败,因
我是一名优秀的程序员,十分优秀!