當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SimpleUrl::addRequestParameters方法代碼示例

本文整理匯總了PHP中SimpleUrl::addRequestParameters方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleUrl::addRequestParameters方法的具體用法?PHP SimpleUrl::addRequestParameters怎麽用?PHP SimpleUrl::addRequestParameters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleUrl的用法示例。


在下文中一共展示了SimpleUrl::addRequestParameters方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: SimpleUrl

 function testGetRequestWithoutIncidentGivesNoErrors()
 {
     $url = new SimpleUrl('http://test:secret@this.com/page.html');
     $url->addRequestParameters(array('a' => 'A', 'b' => 'B'));
     $agent =& new MockRequestUserAgent();
     $agent->setReturnReference('_createHttpRequest', $this->_request);
     $agent->SimpleUserAgent();
     $response =& $agent->fetchResponse(new SimpleUrl('http://test:secret@this.com/page.html'), new SimpleGetEncoding(array('a' => 'A', 'b' => 'B')));
     $this->assertFalse($response->isError());
 }
開發者ID:pvalencia,項目名稱:CoordinaChile,代碼行數:10,代碼來源:user_agent_test.php

示例2: createAbsoluteUrl

 /**
  *    Turns an incoming URL string into a
  *    URL object, filling the relative URL if
  *    a base URL is present.
  *    @param string $base_url       Browser current URL.
  *    @param string $raw_url        Incoming URL.
  *    @param hash $parameters       Additional request, parameters.
  *    @return SimpleUrl             Absolute URL.
  *    @access public
  *    @static
  */
 function createAbsoluteUrl($base_url, $raw_url, $parameters = false)
 {
     $url = new SimpleUrl($raw_url);
     if ($parameters) {
         $url->addRequestParameters($parameters);
     }
     $url->makeAbsolute($base_url);
     return $url;
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:20,代碼來源:user_agent.php

示例3: testHead

 function testHead()
 {
     $headers =& new MockSimpleHttpHeaders($this);
     $headers->setReturnValue('getMimeType', 'text/html');
     $headers->setReturnValue('getResponseCode', 200);
     $headers->setReturnValue('getNewCookies', array());
     $response =& new MockSimpleHttpResponse($this);
     $response->setReturnValue('getContent', 'stuff');
     $response->setReturnReference('getHeaders', $headers);
     $request =& new MockSimpleHttpRequest($this);
     $request->setReturnReference('fetch', $response);
     $url = new SimpleUrl('http://this.com/page.html');
     $url->addRequestParameters(array('a' => 'A', 'b' => 'B'));
     $agent =& new MockRequestUserAgent($this);
     $agent->setReturnReference('_createHttpRequest', $request);
     $agent->expectOnce('_createHttpRequest', array('HEAD', new SimpleUrl('http://test:secret@this.com/page.html?a=A&b=B'), array()));
     $agent->SimpleUserAgent();
     $agent->fetchResponse('HEAD', new SimpleUrl('http://test:secret@this.com/page.html'), array('a' => 'A', 'b' => 'B'));
     $agent->tally();
 }
開發者ID:justinlyon,項目名稱:scc,代碼行數:20,代碼來源:user_agent_test.php

示例4: SimpleHttpPostRequest

 /**
  *    Builds the appropriate HTTP request object.
  *    @param string $method       Fetching method.
  *    @param SimpleUrl $url       Target to fetch as url object.
  *    @param hash $parameters     POST/GET parameters.
  *    @return SimpleHttpRequest   New request object.
  *    @access protected
  */
 function &_createHttpRequest($method, $url, $parameters)
 {
     if ($method == 'POST') {
         $request =& new SimpleHttpPostRequest($url, $parameters);
         return $request;
     }
     if ($parameters) {
         $url->addRequestParameters($parameters);
     }
     return new SimpleHttpRequest($url, $method);
 }
開發者ID:sebs,項目名稱:simpletest,代碼行數:19,代碼來源:user_agent.php

示例5: MockSimpleHttpHeaders

 function _testHead()
 {
     $headers =& new MockSimpleHttpHeaders($this);
     $headers->setReturnValue('getMimeType', 'text/html');
     $headers->setReturnValue('getResponseCode', 200);
     $headers->setReturnValue('getNewCookies', array());
     $response =& new MockSimpleHttpResponse($this);
     $response->setReturnValue("getContent", "stuff");
     $request =& new MockSimpleHttpRequest($this);
     $request->setReturnReference('fetch', $response);
     $url = new SimpleUrl("http://this.com/page.html");
     $url->addRequestParameters(array("a" => "A", "b" => "B"));
     $agent =& new MockRequestUserAgent($this);
     $agent->setReturnReference('_createRequest', $request);
     $agent->expectOnce('_createRequest', array('HEAD', $url, array("a" => "A", "b" => "B")));
     $agent->SimpleUserAgent();
     $agent->fetchResponse('HEAD', 'http://this.com/page.html', array("a" => "A", "b" => "B"));
     $agent->tally();
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:19,代碼來源:user_agent_test.php

示例6: testHead

 function testHead()
 {
     $headers =& new MockSimpleHttpHeaders($this);
     $headers->setReturnValue('getMimeType', 'text/html');
     $headers->setReturnValue('getResponseCode', 200);
     $headers->setReturnValue('getNewCookies', array());
     $response =& new MockSimpleHttpResponse($this);
     $response->setReturnValue('getContent', 'stuff');
     $response->setReturnReference('getHeaders', $headers);
     $request =& new MockSimpleHttpRequest($this);
     $request->setReturnReference('fetch', $response);
     $url = new SimpleUrl('http://this.com/page.html');
     $url->addRequestParameters(array('a' => 'A', 'b' => 'B'));
     $agent =& new MockRequestUserAgent($this);
     $agent->setReturnReference('_createHttpRequest', $request);
     $agent->SimpleUserAgent();
     $agent->fetchResponse('HEAD', 'http://this.com/page.html', array('a' => 'A', 'b' => 'B'));
     $this->assertIdentical($agent->getCurrentUrl(), false);
     $this->assertIdentical($agent->getCurrentMethod(), false);
     $this->assertEqual($agent->getCurrentPostData(), false);
     $agent->tally();
 }
開發者ID:sebs,項目名稱:simpletest,代碼行數:22,代碼來源:user_agent_test.php


注:本文中的SimpleUrl::addRequestParameters方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。