diff --git a/composer.json b/composer.json index c1ef1890..f1424b44 100644 --- a/composer.json +++ b/composer.json @@ -14,9 +14,10 @@ ], "require": { "php": ">=5.4.0", - "guzzlehttp/streams": "~2.1", - "guzzlehttp/ring": "~0.1@dev" + "guzzlehttp/ring": "0.1.*@dev", + "guzzlehttp/streams": "3.0.*@dev" }, + "minimum-stability": "dev", "suggest": { "ext-curl": "Guzzle will use specific adapters if cURL is present" }, diff --git a/src/Post/PostBody.php b/src/Post/PostBody.php index 1fe1c3bf..32ab7fdb 100644 --- a/src/Post/PostBody.php +++ b/src/Post/PostBody.php @@ -205,6 +205,11 @@ class PostBody implements PostBodyInterface return false; } + public function getMetadata($key = null) + { + return $key ? null : []; + } + /** * Return a stream object that is built from the POST fields and files. * diff --git a/src/Post/PostFile.php b/src/Post/PostFile.php index a2922e18..3803d2a5 100644 --- a/src/Post/PostFile.php +++ b/src/Post/PostFile.php @@ -2,7 +2,6 @@ namespace GuzzleHttp\Post; use GuzzleHttp\Mimetypes; -use GuzzleHttp\Stream\MetadataStreamInterface; use GuzzleHttp\Stream\StreamInterface; use GuzzleHttp\Stream\Stream; @@ -92,9 +91,7 @@ class PostFile implements PostFileInterface { $this->filename = $filename; - if (!$this->filename && - $this->content instanceof MetadataStreamInterface - ) { + if (!$this->filename) { $this->filename = $this->content->getMetadata('uri'); } diff --git a/tests/Post/PostFileTest.php b/tests/Post/PostFileTest.php index 2dcdbc92..800cee50 100644 --- a/tests/Post/PostFileTest.php +++ b/tests/Post/PostFileTest.php @@ -1,6 +1,7 @@ getMockBuilder('GuzzleHttp\Post\MultipartBody') - ->setMethods(['getBoundary']) - ->disableOriginalConstructor() - ->getMock(); - $mp->expects($this->once()) - ->method('getBoundary') - ->will($this->returnValue('baz')); - + $mp = new MultipartBody([], [], 'baz'); $p = new PostFile('foo', $mp); $this->assertEquals( 'form-data; name="foo"',