$target = "--testBoundary\r\nContent-Disposition: form-data; name=\"key\"\r\n\r\nvalue\r\n--testBoundary\r\nContent-Disposition: form-data; name=\"testKey\"\r\n\r\ntestValue\r\n--testBoundary\r\nContent-Disposition: form-data; name=\"haveFile\"; filename=\"haveContent\"\r\nContent-Type: contentType\r\n\r\nThis is file test. This sentence must be long\r\n--testBoundary--\r\n";
$this->assertEquals($target, $result);
}
public function testReadFile()
{
$fileField = new FileField();
$fileField->filename = 'composer.json';
$fileField->contentType = 'application/json';
$fileField->content = new Stream(fopen(__DIR__ . '/../composer.json', 'r'));