[HttpFoundation] fixed some unit tests

This commit is contained in:
Fabien Potencier 2013-09-10 23:19:18 +02:00
parent e7386a85d8
commit 6ec2cbaa6c
2 changed files with 10 additions and 0 deletions

View File

@ -410,6 +410,10 @@ class Request
$dup->attributes->set('_format', $this->get('_format'));
}
if (!$dup->getRequestFormat(null)) {
$dup->setRequestFormat($format = $this->getRequestFormat(null));
}
return $dup;
}

View File

@ -284,6 +284,12 @@ class RequestTest extends \PHPUnit_Framework_TestCase
$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());
}
/**