Files
yii2/tests/framework/web/HeaderCollectionTest.php
rhertogh f3956a4eec Fix header collection from array (#18883)
* Fixed HeaderCollection::fromArray() key case

* Added CHANGELOG.md line for #18883 (Fixed HeaderCollection::fromArray() key case)
2021-09-17 09:29:33 +02:00

28 lines
615 B
PHP

<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace yiiunit\framework\web;
use yii\web\HeaderCollection;
use yiiunit\TestCase;
/**
* @group web
*/
class HeaderCollectionTest extends TestCase
{
public function testFromArray()
{
$headerCollection = new HeaderCollection();
$location = 'my-test-location';
$headerCollection->fromArray([
'Location' => [$location],
]);
$this->assertEquals($location, $headerCollection->get('Location'));
}
}