Esempio n. 1
0
 /**
  * @param string[][] $formDataSet
  * @param (string[]|string)[][] $expectResult
  * @dataProvider dictionaryProvider
  */
 public function testEncode(array $formDataSet, array $expectResult)
 {
     $formData = new FormData();
     foreach ($formDataSet as $entry) {
         $formData->append($entry['name'], $entry['value'], $entry['filename'] ?? null, $entry['type'] ?? null);
     }
     $this->assertEquals($expectResult, (new \h4cc\Multipart\ParserSelector())->getParserForContentType(str_replace('content-type: ', '', $formData->getContentType()))->parse($formData->encode()));
 }