You are here

public function RequestTest::testDuplicateWithFormat in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/RequestTest.php \Symfony\Component\HttpFoundation\Tests\RequestTest::testDuplicateWithFormat()

File

vendor/symfony/http-foundation/Tests/RequestTest.php, line 298

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testDuplicateWithFormat() {
  $request = new Request(array(), array(), array(
    '_format' => 'json',
  ));
  $dup = $request
    ->duplicate();
  $this
    ->assertEquals('json', $dup
    ->getRequestFormat());
  $this
    ->assertEquals('json', $dup->attributes
    ->get('_format'));
  $request = new Request();
  $request
    ->setRequestFormat('xml');
  $dup = $request
    ->duplicate();
  $this
    ->assertEquals('xml', $dup
    ->getRequestFormat());
}