use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\Util\ServerParams;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
class ServerParamsTest extends TestCase
{ public function testGetContentLengthFromSuperglobals() { $serverParams =
new ServerParams();
$this->
assertNull($serverParams->
getContentLength());
$_SERVER['CONTENT_LENGTH'
] = 1024;
$this->
assertEquals(1024,
$serverParams->
getContentLength());
unset($_SERVER['CONTENT_LENGTH'
]);
} public function testGetContentLengthFromRequest() { $request = Request::
create('http://foo', 'GET',
[],
[],
[],
['CONTENT_LENGTH' => 1024
]);