Exemplo n.º 1
0
 /**
  * @covers \Guzzle\Http\QueryString::__toString
  * @covers \Guzzle\Http\QueryString::encodeData
  * @covers \Guzzle\Http\QueryString::aggregateUsingPhp
  */
 public function testAllowsNestedQueryData()
 {
     $this->q->replace(array('test' => 'value', 't' => array('v1' => 'a', 'v2' => 'b', 'v3' => array('v4' => 'c', 'v5' => 'd'))));
     $this->q->setEncodeFields(false);
     $this->q->setEncodeValues(false);
     $this->assertEquals('?test=value&t[v1]=a&t[v2]=b&t[v3][v4]=c&t[v3][v5]=d', $this->q->__toString());
 }
Exemplo n.º 2
0
 public function testAllowsMultipleValuesPerKey()
 {
     $q = new QueryString();
     $q->add('facet', 'size');
     $q->add('facet', 'width');
     $q->add('facet.field', 'foo');
     // Use the duplicate aggregator
     $q->setAggregator(new DuplicateAggregator());
     $this->assertEquals('facet=size&facet=width&facet.field=foo', $q->__toString());
 }