Skip to content

Commit 15a121c

Browse files
committed
Clean up
1 parent 78091d5 commit 15a121c

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

tests/PHPCurlClass/PHPCurlClassTest.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -500,20 +500,22 @@ public function testPostFileFormDataContentType()
500500

501501
public function testPostCurlFileFormDataContentType()
502502
{
503-
if (class_exists('CURLFile')) {
504-
$file_path = get_png();
503+
if (!class_exists('CURLFile')) {
504+
return;
505+
}
505506

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();
513508

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));
517519
}
518520

519521
public function testJSONResponse()

0 commit comments

Comments
 (0)