Added tests.

This commit is contained in:
Mitar 2015-11-27 02:45:49 -08:00
parent 59511d97ee
commit e0e51fd79f
1 changed files with 20 additions and 0 deletions

View File

@ -648,6 +648,26 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('http', $request->getServerProtocol());
}
public function testGetServerProtocolWithHttpsServerValueEmpty() {
$this->config
->expects($this->once())
->method('getSystemValue')
->with('overwriteprotocol')
->will($this->returnValue(''));
$request = new Request(
[
'server' => [
'HTTPS' => ''
],
],
$this->secureRandom,
$this->config,
$this->stream
);
$this->assertSame('http', $request->getServerProtocol());
}
public function testGetServerProtocolDefault() {
$this->config
->expects($this->once())