You are here

public function RequestTest::testInitialize 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::testInitialize()

@covers Symfony\Component\HttpFoundation\Request::initialize

1 call to RequestTest::testInitialize()
RequestTest::testConstructor in vendor/symfony/http-foundation/Tests/RequestTest.php
@covers Symfony\Component\HttpFoundation\Request::__construct

File

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

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testInitialize() {
  $request = new Request();
  $request
    ->initialize(array(
    'foo' => 'bar',
  ));
  $this
    ->assertEquals('bar', $request->query
    ->get('foo'), '->initialize() takes an array of query parameters as its first argument');
  $request
    ->initialize(array(), array(
    'foo' => 'bar',
  ));
  $this
    ->assertEquals('bar', $request->request
    ->get('foo'), '->initialize() takes an array of request parameters as its second argument');
  $request
    ->initialize(array(), array(), array(
    'foo' => 'bar',
  ));
  $this
    ->assertEquals('bar', $request->attributes
    ->get('foo'), '->initialize() takes an array of attributes as its third argument');
  $request
    ->initialize(array(), array(), array(), array(), array(), array(
    'HTTP_FOO' => 'bar',
  ));
  $this
    ->assertEquals('bar', $request->headers
    ->get('FOO'), '->initialize() takes an array of HTTP headers as its sixth argument');
}