update v 1.0.7.5
This commit is contained in:
@@ -66,6 +66,34 @@ class MultipartStreamTest extends \PHPUnit_Framework_TestCase
|
||||
. "\r\n\r\nbam\r\n--boundary--\r\n", (string) $b);
|
||||
}
|
||||
|
||||
public function testSerializesNonStringFields()
|
||||
{
|
||||
$b = new MultipartStream([
|
||||
[
|
||||
'name' => 'int',
|
||||
'contents' => (int) 1
|
||||
],
|
||||
[
|
||||
'name' => 'bool',
|
||||
'contents' => (boolean) false
|
||||
],
|
||||
[
|
||||
'name' => 'bool2',
|
||||
'contents' => (boolean) true
|
||||
],
|
||||
[
|
||||
'name' => 'float',
|
||||
'contents' => (float) 1.1
|
||||
]
|
||||
], 'boundary');
|
||||
$this->assertEquals(
|
||||
"--boundary\r\nContent-Disposition: form-data; name=\"int\"\r\nContent-Length: 1\r\n\r\n"
|
||||
. "1\r\n--boundary\r\nContent-Disposition: form-data; name=\"bool\"\r\n\r\n\r\n--boundary"
|
||||
. "\r\nContent-Disposition: form-data; name=\"bool2\"\r\nContent-Length: 1\r\n\r\n"
|
||||
. "1\r\n--boundary\r\nContent-Disposition: form-data; name=\"float\"\r\nContent-Length: 3"
|
||||
. "\r\n\r\n1.1\r\n--boundary--\r\n", (string) $b);
|
||||
}
|
||||
|
||||
public function testSerializesFiles()
|
||||
{
|
||||
$f1 = Psr7\FnStream::decorate(Psr7\stream_for('foo'), [
|
||||
|
||||
Reference in New Issue
Block a user