You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

26 lines
822 B

<?php
namespace GuzzleHttp\Tests\Command\Guzzle\RequestLocation;
use GuzzleHttp\Command\Command;
use GuzzleHttp\Command\Guzzle\Parameter;
use GuzzleHttp\Command\Guzzle\RequestLocation\BodyLocation;
use GuzzleHttp\Psr7\Request;
/**
* @covers \GuzzleHttp\Command\Guzzle\RequestLocation\BodyLocation
*/
class BodyLocationTest extends \PHPUnit_Framework_TestCase
{
/**
* @group RequestLocation
*/
public function testVisitsLocation()
{
$location = new BodyLocation('body');
$command = new Command('foo', ['foo' => 'bar']);
$request = new Request('POST', 'http://httbin.org');
$param = new Parameter(['name' => 'foo']);
$request = $location->visit($command, $request, $param);
$this->assertEquals('foo=bar', $request->getBody()->getContents());
}
}