Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 738de9a

Browse files
committed
[HttpKernel] added a unit for the previous commit (closes #7025)
1 parent d0e4b76 commit 738de9a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,20 +228,22 @@ public function testCreate()
228228
public function testCreateCheckPrecedence()
229229
{
230230
// server is used by default
231-
$request = Request::create('/', 'GET', array(), array(), array(), array(
231+
$request = Request::create('/', 'DELETE', array(), array(), array(), array(
232232
'HTTP_HOST' => 'example.com',
233233
'HTTPS' => 'on',
234234
'SERVER_PORT' => 443,
235235
'PHP_AUTH_USER' => 'fabien',
236236
'PHP_AUTH_PW' => 'pa$$',
237237
'QUERY_STRING' => 'foo=bar',
238+
'CONTENT_TYPE' => 'application/json',
238239
));
239240
$this->assertEquals('example.com', $request->getHost());
240241
$this->assertEquals(443, $request->getPort());
241242
$this->assertTrue($request->isSecure());
242243
$this->assertEquals('fabien', $request->getUser());
243244
$this->assertEquals('pa$$', $request->getPassword());
244245
$this->assertEquals('', $request->getQueryString());
246+
$this->assertEquals('application/json', $request->headers->get('CONTENT_TYPE'));
245247

246248
// URI has precedence over server
247249
$request = Request::create('http://thomas:[email protected]:8080/?foo=bar', 'GET', array(), array(), array(), array(

0 commit comments

Comments
 (0)