Redaxscript\Server\Root::getOutput PHP Метод

getOutput() публичный Метод

get the output
С версии: 2.4.0
public getOutput ( ) : string
Результат string
    public function getOutput()
    {
        $protocol = new Protocol($this->_request);
        $host = new Host($this->_request);
        $directory = new Directory($this->_request);
        /* collect output */
        $output = $protocol->getOutput() . '://' . $host->getOutput();
        if ($directory->getOutput() !== '/' && $directory->getOutput() !== '\\') {
            $output .= $directory->getOutput();
        }
        return $output;
    }

Usage Example

 /**
  * testRoot
  *
  * @since 2.4.0
  */
 public function testRoot()
 {
     /* setup */
     $root = new Server\Root($this->_request);
     /* actual */
     $actual = $root->getOutput();
     /* compare */
     $this->assertEquals('http://localhost/tests/includes/Server', $actual);
 }