ServerBagTest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Tests\Component\HttpFoundation;
  11. use Symfony\Component\HttpFoundation\ServerBag;
  12. /**
  13. * ServerBagTest
  14. *
  15. * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
  16. */
  17. class ServerBagTest extends \PHPUnit_Framework_TestCase
  18. {
  19. public function testShouldExtractHeadersFromServerArray()
  20. {
  21. $server = array(
  22. 'SOME_SERVER_VARIABLE' => 'value',
  23. 'SOME_SERVER_VARIABLE2' => 'value',
  24. 'ROOT' => 'value',
  25. 'HTTP_CONTENT_TYPE' => 'text/html',
  26. 'HTTP_CONTENT_LENGTH' => '0',
  27. 'HTTP_ETAG' => 'asdf',
  28. );
  29. $bag = new ServerBag($server);
  30. $this->assertEquals(array(
  31. 'CONTENT_TYPE' => 'text/html',
  32. 'CONTENT_LENGTH' => '0',
  33. 'ETAG' => 'asdf'
  34. ), $bag->getHeaders());
  35. }
  36. }