Improved argument order
parent
748c4764ba
commit
11b5b5944d
|
@ -25,7 +25,7 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase
|
||||||
->will($this->returnValue(false))
|
->will($this->returnValue(false))
|
||||||
;
|
;
|
||||||
|
|
||||||
$res = $this->callGetOptionsForUrl($io, array(), array('http://example.org'));
|
$res = $this->callGetOptionsForUrl($io, array('http://example.org'));
|
||||||
$this->assertTrue(isset($res['http']['header']) && false !== strpos($res['http']['header'], 'User-Agent'), 'getOptions must return an array with a header containing a User-Agent');
|
$this->assertTrue(isset($res['http']['header']) && false !== strpos($res['http']['header'], 'User-Agent'), 'getOptions must return an array with a header containing a User-Agent');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase
|
||||||
->will($this->returnValue(array('username' => 'login', 'password' => 'password')))
|
->will($this->returnValue(array('username' => 'login', 'password' => 'password')))
|
||||||
;
|
;
|
||||||
|
|
||||||
$options = $this->callGetOptionsForUrl($io, array(), array('http://example.org'));
|
$options = $this->callGetOptionsForUrl($io, array('http://example.org'));
|
||||||
$this->assertContains('Authorization: Basic', $options['http']['header']);
|
$this->assertContains('Authorization: Basic', $options['http']['header']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase
|
||||||
'allow_self_signed' => true,
|
'allow_self_signed' => true,
|
||||||
));
|
));
|
||||||
|
|
||||||
$res = $this->callGetOptionsForUrl($io, $streamOptions, array('https://example.org'));
|
$res = $this->callGetOptionsForUrl($io, array('https://example.org'), $streamOptions);
|
||||||
$this->assertTrue(isset($res['ssl']) && isset($res['ssl']['allow_self_signed']) && true === $res['ssl']['allow_self_signed'], 'getOptions must return an array with a allow_self_signed set to true');
|
$this->assertTrue(isset($res['ssl']) && isset($res['ssl']['allow_self_signed']) && true === $res['ssl']['allow_self_signed'], 'getOptions must return an array with a allow_self_signed set to true');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase
|
||||||
unlink($file);
|
unlink($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function callGetOptionsForUrl($io, array $options = array(), array $args = array())
|
protected function callGetOptionsForUrl($io, array $args = array(), array $options = array())
|
||||||
{
|
{
|
||||||
$fs = new RemoteFilesystem($io, $options);
|
$fs = new RemoteFilesystem($io, $options);
|
||||||
$ref = new \ReflectionMethod($fs, 'getOptionsForUrl');
|
$ref = new \ReflectionMethod($fs, 'getOptionsForUrl');
|
||||||
|
|
Loading…
Reference in New Issue