You are here

public function MultipartStreamTest::testSerializesFields in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/psr7/tests/MultipartStreamTest.php \GuzzleHttp\Tests\MultipartStreamTest::testSerializesFields()

File

vendor/guzzlehttp/psr7/tests/MultipartStreamTest.php, line 51

Class

MultipartStreamTest

Namespace

GuzzleHttp\Tests

Code

public function testSerializesFields() {
  $b = new MultipartStream([
    [
      'name' => 'foo',
      'contents' => 'bar',
    ],
    [
      'name' => 'baz',
      'contents' => 'bam',
    ],
  ], 'boundary');
  $this
    ->assertEquals("--boundary\r\nContent-Disposition: form-data; name=\"foo\"\r\nContent-Length: 3\r\n\r\n" . "bar\r\n--boundary\r\nContent-Disposition: form-data; name=\"baz\"\r\nContent-Length: 3" . "\r\n\r\nbam\r\n--boundary--\r\n", (string) $b);
}