Skip to content

Commit 7eb413b

Browse files
committed
Merge pull request php-curl-class#239 from zachborboa/master
Add test for php-curl-class#193
2 parents 70ef132 + 145e7b7 commit 7eb413b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/PHPCurlClass/PHPCurlClassTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,26 @@ public function testPostAssociativeArrayData()
321321
);
322322
}
323323

324+
public function testPostContentLength()
325+
{
326+
$test_data = array(
327+
array(false, 0),
328+
array('', 0),
329+
array(array(), 0),
330+
array(null, 0),
331+
);
332+
foreach ($test_data as $data) {
333+
$test = new Test();
334+
list($post_data, $expected_content_length) = $data;
335+
if ($post_data === false) {
336+
$test->server('post', 'POST');
337+
} else {
338+
$test->server('post', 'POST', $post_data);
339+
}
340+
$this->assertEquals($expected_content_length, $test->curl->requestHeaders['Content-Length']);
341+
}
342+
}
343+
324344
public function testPostMultidimensionalData()
325345
{
326346
$test = new Test();

0 commit comments

Comments
 (0)