@@ -2567,6 +2567,27 @@ public function testJsonContentTypeDetection()
2567
2567
}
2568
2568
}
2569
2569
2570
+ public function testXmlContentTypeDetection ()
2571
+ {
2572
+ $ xml_content_types = array (
2573
+ 'application/atom+xml ' ,
2574
+ 'application/rss+xml ' ,
2575
+ 'application/soap+xml ' ,
2576
+ 'application/xml ' ,
2577
+ 'text/xml ' ,
2578
+ );
2579
+
2580
+ $ class = new \ReflectionClass ('\Curl\Curl ' );
2581
+ $ property = $ class ->getProperty ('xmlPattern ' );
2582
+ $ property ->setAccessible (true );
2583
+ $ xml_pattern = $ property ->getValue (new Curl );
2584
+
2585
+ foreach ($ xml_content_types as $ xml_content_type ) {
2586
+ $ message = '" ' . $ xml_content_type . '" does not match pattern ' . $ xml_pattern ;
2587
+ $ this ->assertEquals (1 , preg_match ($ xml_pattern , $ xml_content_type ), $ message );
2588
+ }
2589
+ }
2590
+
2570
2591
public function testXMLResponse ()
2571
2592
{
2572
2593
foreach (array (
@@ -2579,6 +2600,9 @@ public function testXMLResponse()
2579
2600
'application/rss+xml ' ,
2580
2601
'application/rss+xml; charset=utf-8 ' ,
2581
2602
'application/rss+xml;charset=utf-8 ' ,
2603
+ 'application/soap+xml ' ,
2604
+ 'application/soap+xml; charset=utf-8 ' ,
2605
+ 'application/soap+xml;charset=utf-8 ' ,
2582
2606
'application/xml ' ,
2583
2607
'application/xml; charset=utf-8 ' ,
2584
2608
'application/xml;charset=utf-8 ' ,
0 commit comments