From bf10280cdb86ed1c86122cd5b1882cd401d1cf49 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Thu, 26 Mar 2015 08:22:09 -0700 Subject: [PATCH] Add test for #154 --- tests/PHPCurlClass/PHPCurlClassTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/PHPCurlClass/PHPCurlClassTest.php b/tests/PHPCurlClass/PHPCurlClassTest.php index 8dc4826..466b555 100644 --- a/tests/PHPCurlClass/PHPCurlClassTest.php +++ b/tests/PHPCurlClass/PHPCurlClassTest.php @@ -64,6 +64,22 @@ class CurlTest extends PHPUnit_Framework_TestCase $this->assertCount(2, $array); } + public function testBuildPostDataArgSeparator() + { + $data = array( + 'foo' => 'Hello', + 'bar' => 'World', + ); + + foreach (array(false, '&', '&') as $arg_separator) { + if ($arg_separator) { + ini_set('arg_separator.output', $arg_separator); + } + $curl = new Curl(); + $this->assertEquals('foo=Hello&bar=World', $curl->buildPostData($data)); + } + } + public function testUserAgent() { $php_version = 'PHP\/' . PHP_VERSION;