getRequest() public method

Get a request parameter.
public getRequest ( string $name ) : string
$name string
return string
 public function testCustomRequest()
 {
     $request = Request::create("/bolt/test/location", "GET", array(), array(), array(), array('HTTP_HOST' => 'test.dev', 'SERVER_PROTOCOL' => 'https'));
     $config = new ResourceManager(TEST_ROOT, $request);
     $app = new Application(array('resources' => $config));
     $this->assertEquals("https", $config->getRequest("protocol"));
     $this->assertEquals("test.dev", $config->getRequest("hostname"));
     $this->assertEquals("https://bolt.dev/bolt/test/location", $config->getUrl("canonical"));
 }
Ejemplo n.º 2
0
 public function testCustomRequest()
 {
     $request = Request::create('/bolt/test/location', 'GET', [], [], [], ['HTTP_HOST' => 'test.dev', 'SERVER_PROTOCOL' => 'https']);
     $config = new ResourceManager(new \Pimple(['rootpath' => TEST_ROOT, 'request' => $request, 'pathmanager' => new PlatformFileSystemPathFactory()]));
     $config->compat();
     $app = new Application(['resources' => $config]);
     $this->assertEquals('https', $config->getRequest('protocol'));
     $this->assertEquals('test.dev', $config->getRequest('hostname'));
     $this->assertEquals('http://bolt.dev/bolt/test/location', $config->getUrl('canonical'));
 }