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.

34 lines
1.1 KiB

12 months ago
<?php
namespace GuzzleHttp\Tests\Command\Guzzle\RequestLocation;
use GuzzleHttp\Command\Command;
use GuzzleHttp\Command\Guzzle\Operation;
use GuzzleHttp\Command\Guzzle\Parameter;
use GuzzleHttp\Command\Guzzle\RequestLocation\MultiPartLocation;
use GuzzleHttp\Command\Guzzle\RequestLocation\PostFileLocation;
use GuzzleHttp\Psr7\Request;
/**
* @covers \GuzzleHttp\Command\Guzzle\RequestLocation\MultiPartLocation
*/
class MultiPartLocationTest extends \PHPUnit_Framework_TestCase
{
/**
* @group RequestLocation
*/
public function testVisitsLocation()
{
$location = new MultiPartLocation();
$command = new Command('foo', ['foo' => 'bar']);
$request = new Request('POST', 'http://httbin.org', []);
$param = new Parameter(['name' => 'foo']);
$request = $location->visit($command, $request, $param);
$operation = new Operation();
$request = $location->after($command, $request, $operation);
$actual = $request->getBody()->getContents();
$this->assertNotFalse(strpos($actual, 'name="foo"'));
$this->assertNotFalse(strpos($actual, 'bar'));
}
}