当前位置: 首页>>代码示例>>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;未经允许,请勿转载。