Closed seregazhuk closed 6 years ago
@seregazhuk Thanks for reporting! I'm not too familiar with this particular code, can we add a test for this? :+1:
@clue Done! I was a bit confused because the test for this use case already exists. But it only checks that the promise rejects. So, when the code fails, the promise rejects as it was expected in the test but with Illegal string offset 'message'
message. I've updated the test to check the rejection reason of the promise.
@clue yeah it is an functional test that fails (works on my machine) so I'm working on it in my labs fork to find out how to fix it.
When calling
exists()
orstat()
on file object and a specified file doesn't exists the code fails. The reason is that everywhere inReact\Filesystem\WoolTrait
for rejecting promises is being usederror_get_last()
function. But when checking for existence you specify a custom array that has some different structure than the result oferror_get_last()
. In this case here it fails:https://github.com/reactphp/filesystem/blob/master/src/ChildProcess/Adapter.php#L134
because there is no such key as
message
.