コード例 #1
0
ファイル: Client.php プロジェクト: khalid05/symfony
 /**
  * Makes a request from a Request object directly.
  *
  * @param Symfony\Components\BrowserKit\Request $request       A Request instance
  * @param Boolean                               $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload())
  *
  * @return Symfony\Components\DomCrawler\Crawler
  */
 protected function requestFromRequest(Request $request, $changeHistory = true)
 {
     return $this->request($request->getMethod(), $request->getUri(), $request->getParameters(), array(), $request->getFiles(), $request->getServer(), $changeHistory);
 }
コード例 #2
0
ファイル: Client.php プロジェクト: pgodel/PageRoller
 /**
  * Converts the BrowserKit request to a HttpKernel request.
  *
  * @param Symfony\Components\BrowserKit\Request $request A Request instance
  *
  * @return Symfony\Components\HttpKernel\Request A Request instance
  */
 protected function filterRequest(DomRequest $request)
 {
     $uri = $request->getUri();
     if (preg_match('#^https?\\://([^/]+)/(.*)$#', $uri, $matches)) {
         $uri = '/' . $matches[2];
     }
     return Request::create($uri, $request->getMethod(), $request->getParameters(), $request->getFiles(), $request->getCookies(), $request->getServer());
 }
コード例 #3
0
 public function testGetServer()
 {
     $request = new Request('http://www.example.com/', 'get', array(), array(), array(), array('foo' => 'bar'));
     $this->assertEquals(array('foo' => 'bar'), $request->getServer(), '->getServer() returns the server parameters of the request');
 }