mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-24 10:03:27 +01:00
Adding attach() to PostBody
This commit is contained in:
parent
46bead5c15
commit
acc07b324b
@ -2,6 +2,7 @@
|
||||
namespace GuzzleHttp\Post;
|
||||
|
||||
use GuzzleHttp\Message\RequestInterface;
|
||||
use GuzzleHttp\Stream\Exception\CannotAttachException;
|
||||
use GuzzleHttp\Stream\StreamInterface;
|
||||
use GuzzleHttp\Stream\Stream;
|
||||
use GuzzleHttp\Query;
|
||||
@ -161,9 +162,9 @@ class PostBody implements PostBodyInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function isDetached()
|
||||
public function attach($stream)
|
||||
{
|
||||
return $this->detached;
|
||||
throw new CannotAttachException();
|
||||
}
|
||||
|
||||
public function eof()
|
||||
|
@ -149,9 +149,7 @@ class PostBodyTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$b = new PostBody();
|
||||
$b->setField('foo', 'bar');
|
||||
$this->assertFalse($b->isDetached());
|
||||
$b->detach();
|
||||
$this->assertTrue($b->isDetached());
|
||||
$b->close();
|
||||
$this->assertEquals('', $b->read(10));
|
||||
}
|
||||
@ -162,7 +160,6 @@ class PostBodyTest extends \PHPUnit_Framework_TestCase
|
||||
$b->setField('foo', 'bar');
|
||||
$b->getContents();
|
||||
$b->detach();
|
||||
$this->assertTrue($b->isDetached());
|
||||
}
|
||||
|
||||
public function testFlushAndMetadataPlaceholders()
|
||||
|
Loading…
x
Reference in New Issue
Block a user