Esempio n. 1
0
 public function testServer()
 {
     $h = new Url($this->container);
     $this->assertEquals('http://localhost/', $h->server());
     $_SERVER['PHP_SELF'] = '/';
     $_SERVER['SERVER_NAME'] = 'kb';
     $_SERVER['SERVER_PORT'] = 1234;
     $this->assertEquals('http://kb:1234/', $h->server());
 }
 public function testServer()
 {
     $this->container['request'] = new Request($this->container, array('PHP_SELF' => '/index.php', 'REQUEST_METHOD' => 'GET', 'SERVER_NAME' => 'localhost', 'SERVER_PORT' => 80));
     $h = new Url($this->container);
     $this->assertEquals('http://localhost/', $h->server());
     $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->server());
 }