public function getHttpProtocol() { // Copied from https://github.com/facebook/facebook-php-sdk /*apache + variants specific way of checking for https*/ if (in_array($this->server->get('HTTPS'), array(1, 'on', '1'), true)) { return 'https'; } /*nginx way of checking for https*/ if ($this->server->get('SERVER_PORT') === '443') { return 'https'; } return 'http'; }
public function testRemove() { $map = new \Bonder\Collections\Map(); $map->set("mykey", 79); $map->remove("mykey"); $this->assertNull($map->get("mykey")); $this->assertTrue($map->isEmpty()); $this->assertEquals(0, $map->size()); }