Esempio n. 1
0
 public function testConstructUrl()
 {
     $request = new THttpRequest();
     $request->init(null);
     // Try to construct an url to the pageservice with some parameters
     $url = $request->constructURL('page', 'Home', array('param1' => 'value1', 'param2' => 'value2'), true);
     self::assertEquals('/demos/personal/index.php?page=Home&param1=value1&param2=value2', $url);
     // Try without encode &
     $url = $request->constructURL('page', 'Home', array('param1' => 'value1', 'param2' => 'value2'), false);
     self::assertEquals('/demos/personal/index.php?page=Home&param1=value1&param2=value2', $url);
     // Try to use HTTPS even if the current request is sent via HTTP
     //$url=$request->constructURL('page','Home',array('param1'=>'value1','param2'=>'value2'), false, false, true);
     //self::assertEquals('https', substr($url,0,5));
 }