1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
<?php
namespace Guzzle\Tests\Http;
use Guzzle\Http\QueryString;
use Guzzle\Http\QueryAggregator\CommaAggregator as Ag;
class CommaAggregatorTest extends \Guzzle\Tests\GuzzleTestCase
{
public function testAggregates()
{
$query = new QueryString();
$a = new Ag();
$key = 'test 123';
$value = array('foo 123', 'baz', 'bar');
$result = $a->aggregate($key, $value, $query);
$this->assertEquals(array('test%20123' => 'foo%20123,baz,bar'), $result);
}
public function testEncodes()
{
$query = new QueryString();
$query->useUrlEncoding(false);
$a = new Ag();
$key = 'test 123';
$value = array('foo 123', 'baz', 'bar');
$result = $a->aggregate($key, $value, $query);
$this->assertEquals(array('test 123' => 'foo 123,baz,bar'), $result);
}
}