cphalcon
cphalcon copied to clipboard
Phalcon\Http\Response::setContentType charset param not working
Unable to set charset when using the Phalcon\Http\Response::setContentType method. See unit test update below.
Thanks!
// ResponseTest.php
class ResponseTest extends PHPUnit_Framework_TestCase
{
...
public function testSetContentType()
{
$this->_response->resetHeaders();
$this->_response->setContentType('application/json', 'utf-8');
$this->assertEquals(Phalcon\Http\Response\Headers::__set_state(array(
'_headers' => array(
'Content-Type' => 'application/json; charset=utf-8'
)
)), $this->_response->getHeaders());
}
Thanks nesbert, this is now fixed, good night