/** * test for IsHttp * * @return array */ public function testIsHttps() { $this->object->set('is_https', null); $this->object->set('PmaAbsoluteUri', 'http://some_host.com/phpMyAdmin'); $this->assertFalse($this->object->isHttps()); $this->object->set('is_https', null); $this->object->set('PmaAbsoluteUri', 'https://some_host.com/phpMyAdmin'); $this->assertTrue($this->object->isHttps()); }
/** * test for IsHttp * * @return void * * @dataProvider httpsParams */ public function testIsHttps($scheme, $https, $uri, $lb, $front, $proto, $port, $expected) { $_SERVER['HTTP_SCHEME'] = $scheme; $_SERVER['HTTPS'] = $https; $_SERVER['REQUEST_URI'] = $uri; $_SERVER['HTTP_HTTPS_FROM_LB'] = $lb; $_SERVER['HTTP_FRONT_END_HTTPS'] = $front; $_SERVER['HTTP_X_FORWARDED_PROTO'] = $proto; $_SERVER['SERVER_PORT'] = $port; $this->object->set('is_https', null); $this->assertEquals($expected, $this->object->isHttps()); }