setQuery() public méthode

set item to query
Since: 2.2.0
public setQuery ( string $key = null, string $value = null )
$key string key of the item
$value string value of the item
Exemple #1
0
 /**
  * testQuery
  *
  * @since 2.2.0
  */
 public function testQuery()
 {
     /* setup */
     Request::setQuery('testKey', 'testValue');
     /* result */
     $result = Request::getQuery('testKey');
     /* compare */
     $this->assertEquals('testValue', $result);
 }
Exemple #2
0
 /**
  * testDetectorTemplate
  *
  * @since 2.2.0
  */
 public function testDetectorQuery()
 {
     /* setup */
     Request::setQuery('l', 'en');
     Request::setQuery('t', 'default');
     $this->_registry->init();
     $detectorLanguage = new Detector\Language($this->_registry);
     $detectorTemplate = new Detector\Template($this->_registry);
     /* result */
     $resultLanguage = $detectorLanguage->getOutput();
     $resultTemplate = $detectorTemplate->getOutput();
     /* compare */
     $this->assertEquals('en', $resultLanguage);
     $this->assertEquals('default', $resultTemplate);
 }