4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\BrowserKit\Tests;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\BrowserKit\Request;
17 class RequestTest extends TestCase
19 public function testGetUri()
21 $request = new Request('http://www.example.com/', 'get');
22 $this->assertEquals('http://www.example.com/', $request->getUri(), '->getUri() returns the URI of the request');
25 public function testGetMethod()
27 $request = new Request('http://www.example.com/', 'get');
28 $this->assertEquals('get', $request->getMethod(), '->getMethod() returns the method of the request');
31 public function testGetParameters()
33 $request = new Request('http://www.example.com/', 'get', array('foo' => 'bar'));
34 $this->assertEquals(array('foo' => 'bar'), $request->getParameters(), '->getParameters() returns the parameters of the request');
37 public function testGetFiles()
39 $request = new Request('http://www.example.com/', 'get', array(), array('foo' => 'bar'));
40 $this->assertEquals(array('foo' => 'bar'), $request->getFiles(), '->getFiles() returns the uploaded files of the request');
43 public function testGetCookies()
45 $request = new Request('http://www.example.com/', 'get', array(), array(), array('foo' => 'bar'));
46 $this->assertEquals(array('foo' => 'bar'), $request->getCookies(), '->getCookies() returns the cookies of the request');
49 public function testGetServer()
51 $request = new Request('http://www.example.com/', 'get', array(), array(), array(), array('foo' => 'bar'));
52 $this->assertEquals(array('foo' => 'bar'), $request->getServer(), '->getServer() returns the server parameters of the request');