当前位置: 首页>>代码示例>>PHP>>正文


PHP JRouter::setVars方法代码示例

本文整理汇总了PHP中JRouter::setVars方法的典型用法代码示例。如果您正苦于以下问题:PHP JRouter::setVars方法的具体用法?PHP JRouter::setVars怎么用?PHP JRouter::setVars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JRouter的用法示例。


在下文中一共展示了JRouter::setVars方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testCreateUriGeneratesUriFromUrlAndPreset

 /**
  * Tests createUri() method
  *
  * @param   array  $url      valid inputs to the createUri() method
  * @param   array  $preset   global Vars that should be merged into the URL
  * @param   string $expected expected URI string
  *
  * @dataProvider casesCreateUri
  * @testdox      createUri() generates URI combining URL and preset variables
  * @since        3.4
  */
 public function testCreateUriGeneratesUriFromUrlAndPreset($url, $preset, $expected)
 {
     $this->object->setVars($preset, false);
     $createUriMethod = new ReflectionMethod('JRouter', 'createUri');
     $createUriMethod->setAccessible(true);
     $this->assertEquals($expected, (string) $createUriMethod->invoke($this->object, $url));
 }
开发者ID:Rai-Ka,项目名称:joomla-cms,代码行数:18,代码来源:JRouterTest.php

示例2: testCreateURI

 /**
  * Tests createURI() method
  *
  * @param   array   $url         valid inputs to the createURI() method
  * @param   array   $globalVars  global Vars that should be merged into the URL
  * @param   string  $expected    expected URI string
  *
  * @dataProvider casesCreateURI
  *
  * @return void
  *
  * @since  3.4
  */
 public function testCreateURI($url, $globalVars, $expected)
 {
     $this->object->setVars($globalVars, false);
     $juri = $this->object->runCreateURI($url);
     $this->assertTrue(is_a($juri, 'JUri'));
     $this->assertEquals($juri->toString(), $expected);
 }
开发者ID:nirpan,项目名称:joomla-cms,代码行数:20,代码来源:JRouterSiteTest.php

示例3: testGetVars

 /**
  * Tests the getVars() method
  *
  * @return void
  *
  * @since  3.4
  */
 public function testGetVars()
 {
     $this->assertEquals($this->object->getVars(), array());
     $this->object->setVars(array('var1' => 'value1'));
     $this->assertEquals($this->object->getVars(), array('var1' => 'value1'));
     $this->object->setVars(array('var2' => 'value2'));
     $this->assertEquals($this->object->getVars(), array('var1' => 'value1', 'var2' => 'value2'));
     $this->object->setVars(array('var3' => 'value3'), false);
     $this->assertEquals($this->object->getVars(), array('var3' => 'value3'));
     $this->object->setVars(array(), false);
     $this->assertEquals($this->object->getVars(), array());
 }
开发者ID:nirpan,项目名称:joomla-cms,代码行数:19,代码来源:JRouterTest.php

示例4: testSetVar

 /**
  * Tests the setVar method
  *
  * @param   array    $vars      An associative array with variables
  * @param   string   $var       The name of the variable
  * @param   mixed    $value     The value of the variable
  * @param   boolean  $create    If True, the variable will be created if it doesn't exist yet
  * @param   string   $expected  Expected return value
  *
  * @return  void
  *
  * @dataProvider  casesSetVar
  * @since         3.1
  */
 public function testSetVar($vars, $var, $value, $create, $expected)
 {
     $this->object->setVars($vars, false);
     $this->object->setVar($var, $value, $create);
     $this->assertEquals($this->object->getVar($var), $expected, __METHOD__ . ':' . __LINE__ . ': value is not expected');
 }
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:20,代码来源:JRouterTest.php


注:本文中的JRouter::setVars方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。