@@ -500,20 +500,22 @@ public function testPostFileFormDataContentType()
500
500
501
501
public function testPostCurlFileFormDataContentType ()
502
502
{
503
- if (class_exists ('CURLFile ' )) {
504
- $ file_path = get_png ();
503
+ if (!class_exists ('CURLFile ' )) {
504
+ return ;
505
+ }
505
506
506
- $ test = new Test ();
507
- $ test ->server ('server ' , 'POST ' , array (
508
- 'image ' => new CURLFile ($ file_path ),
509
- ));
510
- $ this ->assertEquals ($ test ->curl ->request_headers ['Expect ' ], '100-continue ' );
511
- preg_match ('/^multipart\/form-data; boundary=/ ' , $ test ->curl ->request_headers ['Content-Type ' ], $ content_type );
512
- $ this ->assertTrue (!empty ($ content_type ));
507
+ $ file_path = get_png ();
513
508
514
- unlink ($ file_path );
515
- $ this ->assertFalse (file_exists ($ file_path ));
516
- }
509
+ $ test = new Test ();
510
+ $ test ->server ('server ' , 'POST ' , array (
511
+ 'image ' => new CURLFile ($ file_path ),
512
+ ));
513
+ $ this ->assertEquals ($ test ->curl ->request_headers ['Expect ' ], '100-continue ' );
514
+ preg_match ('/^multipart\/form-data; boundary=/ ' , $ test ->curl ->request_headers ['Content-Type ' ], $ content_type );
515
+ $ this ->assertTrue (!empty ($ content_type ));
516
+
517
+ unlink ($ file_path ) ;
518
+ $ this ->assertFalse (file_exists ($ file_path ));
517
519
}
518
520
519
521
public function testJSONResponse ()
0 commit comments