Commit 9a9618a2 authored by Kevin Herrera's avatar Kevin Herrera

Ignore URIs when performing is_file() check.

parent b799a585
......@@ -90,7 +90,8 @@ class Json
$assoc = false,
$depth = 512,
$options = 0){
if (false === is_file($file)) {
if ((false == preg_match('/^\w+:\/\//', $file)) &&
(false === is_file($file))) {
throw FileException::create(
'The path "%s" is not a file or does not exist.',
$file
......
......@@ -55,6 +55,16 @@ class JsonTest extends TestCase
$this->assertEquals((object) $data, $this->json->decodeFile($file));
}
public function testDecodeFileIgnoreUri()
{
$this->setExpectedException(
'Herrera\\Json\\Exception\\FileException',
'failed to open stream'
);
$this->json->decodeFile('vfs://test/ignore.json');
}
public function testDecodeFileNotExist()
{
$this->setExpectedException(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment