From a0c52a82532fa957d9ba42ea726d788d6fd84c27 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sun, 23 May 2021 19:34:28 +0000
Subject: [PATCH] Added real test data

---
 tests/datasets/http/example1.httpinput | 53 ++++++++++++++++++++++++--
 tests/src/Util/HTTPInputDataTest.php   | 17 ++++++++-
 2 files changed, 65 insertions(+), 5 deletions(-)

diff --git a/tests/datasets/http/example1.httpinput b/tests/datasets/http/example1.httpinput
index 24cef8c82d..b1498e476f 100644
--- a/tests/datasets/http/example1.httpinput
+++ b/tests/datasets/http/example1.httpinput
@@ -1,3 +1,50 @@
-anything you want
-As you
-like it
+--43395968-f65c-437e-b536-5b33e3e3c7e5
+Content-Disposition: form-data; name="display_name"
+Content-Transfer-Encoding: binary
+Content-Type: multipart/form-data; charset=utf-8
+Content-Length: 9
+
+User Name
+--43395968-f65c-437e-b536-5b33e3e3c7e5
+Content-Disposition: form-data; name="note"
+Content-Transfer-Encoding: binary
+Content-Type: multipart/form-data; charset=utf-8
+Content-Length: 8
+
+About me
+--43395968-f65c-437e-b536-5b33e3e3c7e5
+Content-Disposition: form-data; name="locked"
+Content-Transfer-Encoding: binary
+Content-Type: multipart/form-data; charset=utf-8
+Content-Length: 5
+
+false
+--43395968-f65c-437e-b536-5b33e3e3c7e5
+Content-Disposition: form-data; name="fields_attributes[0][name]"
+Content-Transfer-Encoding: binary
+Content-Type: multipart/form-data; charset=utf-8
+Content-Length: 10
+
+variable 1
+--43395968-f65c-437e-b536-5b33e3e3c7e5
+Content-Disposition: form-data; name="fields_attributes[0][value]"
+Content-Transfer-Encoding: binary
+Content-Type: multipart/form-data; charset=utf-8
+Content-Length: 7
+
+value 1
+--43395968-f65c-437e-b536-5b33e3e3c7e5
+Content-Disposition: form-data; name="fields_attributes[1][name]"
+Content-Transfer-Encoding: binary
+Content-Type: multipart/form-data; charset=utf-8
+Content-Length: 10
+
+variable 2
+--43395968-f65c-437e-b536-5b33e3e3c7e5
+Content-Disposition: form-data; name="fields_attributes[1][value]"
+Content-Transfer-Encoding: binary
+Content-Type: multipart/form-data; charset=utf-8
+Content-Length: 7
+
+value 2
+--43395968-f65c-437e-b536-5b33e3e3c7e5--
diff --git a/tests/src/Util/HTTPInputDataTest.php b/tests/src/Util/HTTPInputDataTest.php
index a343e1a76e..ea7df9c62a 100644
--- a/tests/src/Util/HTTPInputDataTest.php
+++ b/tests/src/Util/HTTPInputDataTest.php
@@ -39,13 +39,26 @@ class HTTPInputDataTest extends MockedTest
 	 */
 	public function dataStream()
 	{
+		$_SERVER['CONTENT_TYPE'] = 'multipart/form-data;boundary=43395968-f65c-437e-b536-5b33e3e3c7e5;charset=utf8';
+
 		return [
 			'example' => [
 				'input'    => file_get_contents(__DIR__ . '/../../datasets/http/example1.httpinput'),
 				'expected' => [
 					'variables' => [
-						'var1' => 'value1',
-						'var2' => 'value2',
+						'display_name' => 'User Name',
+						'note' => 'About me',
+						'locked' => false,
+						'fields_attributes' => [
+							0 => [
+								'name' => 'variable 1',
+								'value' => 'value 1',
+							],
+							1 => [
+								'name' => 'variable 2',
+								'value' => 'value 2',
+							]
+						]
 					],
 					'files' => []
 				]
-- 
2.39.5