public function testBase() { $this->container['request'] = new Request($this->container, array('PHP_SELF' => '/index.php', 'REQUEST_METHOD' => 'GET', 'SERVER_NAME' => 'kb', 'SERVER_PORT' => 1234)); $h = new Url($this->container); $this->assertEquals('http://kb:1234/', $h->base()); $c = new Config($this->container); $c->save(array('application_url' => 'https://mykanboard/')); $h = new Url($this->container); $this->assertEquals('https://mykanboard/', $c->get('application_url')); $this->assertEquals('https://mykanboard/', $h->base()); }
public function testBase() { $h = new Url($this->container); $this->assertEquals('http://localhost/', $h->base()); $_SERVER['PHP_SELF'] = '/'; $_SERVER['SERVER_NAME'] = 'kb'; $_SERVER['SERVER_PORT'] = 1234; $h = new Url($this->container); $this->assertEquals('http://kb:1234/', $h->base()); $c = new Config($this->container); $c->save(array('application_url' => 'https://mykanboard/')); $h = new Url($this->container); $this->assertEquals('https://mykanboard/', $c->get('application_url')); $this->assertEquals('https://mykanboard/', $h->base()); }