コード例 #1
0
ファイル: run.php プロジェクト: canerdogan/php-curl-class
 public function testPostFilePathUpload()
 {
     $file_path = get_png();
     $test = new Test();
     $this->assertTrue($test->server('post_file_path_upload', 'POST', array('key' => 'image', 'image' => '@' . $file_path)) === 'image/png');
     unlink($file_path);
 }
コード例 #2
0
 public function testPostCurlFileUpload()
 {
     if (class_exists('CURLFile')) {
         $file_path = get_png();
         $test = new Test();
         $this->assertTrue($test->server('post_file_path_upload', 'POST', array('key' => 'image', 'image' => new CURLFile($file_path))) === 'image/png');
         unlink($file_path);
         $this->assertFalse(file_exists($file_path));
     }
 }