]> git.mxchange.org Git - friendica.git/commitdiff
Test with file (will fail)
authorMichael <heluecht@pirati.ca>
Mon, 24 May 2021 04:56:03 +0000 (04:56 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 24 May 2021 04:56:03 +0000 (04:56 +0000)
tests/datasets/http/multipart-file.httpinput [new file with mode: 0644]
tests/src/Util/HTTPInputDataTest.php

diff --git a/tests/datasets/http/multipart-file.httpinput b/tests/datasets/http/multipart-file.httpinput
new file mode 100644 (file)
index 0000000..a1bc0de
Binary files /dev/null and b/tests/datasets/http/multipart-file.httpinput differ
index 8f05703b24373a17e608c4b9ed6cdb88ef0b1d81..6bcc42a860a0defdc686d067bfa277efc03dd0d6 100644 (file)
@@ -64,6 +64,42 @@ class HTTPInputDataTest extends MockedTest
                                        'files' => []
                                ]
                        ],
+                       'multipart-file' => [
+                               'contenttype' => 'multipart/form-data;boundary=6d4d5a40-651a-4468-a62e-5a6ca2bf350d;charset=utf8',
+                               'input'       => file_get_contents(__DIR__ . '/../../datasets/http/multipart.httpinput'),
+                               'expected'    => [
+                                       'variables' => [
+                                               'display_name'      => 'Vorname Nachname',
+                                               'note'              => 'About me',
+                                               'fields_attributes' => [
+                                                       0 => [
+                                                               'name'  => 'variable 1',
+                                                               'value' => 'value 1',
+                                                       ],
+                                                       1 => [
+                                                               'name'  => 'variable 2',
+                                                               'value' => 'value 2',
+                                                       ]
+                                               ]
+                                       ],
+                                       'files' => [
+                                               'avatar' => [
+                                                       'name' => '8ZUCS34Y5XNH',
+                                                       'type' => 'image/png',
+                                                       'tmp_name' => '/tmp/phpf85nKJ',
+                                                       'error' => 0,
+                                                       'size' => 349330
+                                               ],              
+                                               'header' => [
+                                                       'name' => 'V2B6Z1IICGPM',
+                                                       'type' => 'image/png',
+                                                       'tmp_name' => '/tmp/phpe3sqHT',
+                                                       'error' => 0,
+                                                       'size' => 1323635
+                                               ]
+                                       ]
+                               ]
+                       ],
                        'form-urlencoded' => [
                                'contenttype' => 'application/x-www-form-urlencoded;charset=utf8',
                                'input'       => file_get_contents(__DIR__ . '/../../datasets/http/form-urlencoded.httpinput'),