From 0bab1dd46cd8a7d44990d403a9cbf0f4a1d48447 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sun, 7 Dec 2014 21:51:27 -0800 Subject: [PATCH] Add test for parsing empty response (#96) --- tests/PHPCurlClass/PHPCurlClassTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/PHPCurlClass/PHPCurlClassTest.php b/tests/PHPCurlClass/PHPCurlClassTest.php index f3917e1..ff5aeb6 100644 --- a/tests/PHPCurlClass/PHPCurlClassTest.php +++ b/tests/PHPCurlClass/PHPCurlClassTest.php @@ -716,6 +716,18 @@ class CurlTest extends PHPUnit_Framework_TestCase xmlAssertion('CONTENT-TYPE', 'text/xml;charset=utf-8'); } + public function testEmptyResponse() + { + $response = "\r\n\r\n"; + + $reflector = new ReflectionClass('\Curl\Curl'); + $reflection_method = $reflector->getMethod('parseResponse'); + $reflection_method->setAccessible(true); + + $curl = new Curl(); + $reflection_method->invoke($curl, $response); + } + public function testArrayToStringConversion() { $test = new Test();