Changeset 7776
- Timestamp:
- 03/08/08 08:06:03 (1 year ago)
- Files:
-
- branches/1.1/lib/response/sfWebResponse.class.php (modified) (2 diffs)
- branches/1.1/test/unit/response/sfWebResponseTest.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/response/sfWebResponse.class.php
r7733 r7776 99 99 $this->options['charset'] = 'utf-8'; 100 100 } 101 102 $this->setContentType(isset($this->options['content_type']) ? $this->options['content_type'] : 'text/html'); 101 103 } 102 104 … … 270 272 public function getContentType() 271 273 { 272 return $this->getHttpHeader('Content-Type' , 'text/html; charset='.$this->options['charset']);274 return $this->getHttpHeader('Content-Type'); 273 275 } 274 276 branches/1.1/test/unit/response/sfWebResponseTest.php
r7733 r7776 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(7 0, new lime_output_color());13 $t = new lime_test(72, new lime_output_color()); 14 14 15 15 class myWebResponse extends sfWebResponse … … 27 27 28 28 $dispatcher = new sfEventDispatcher(); 29 30 // ->initialize() 31 $t->diag('->initialize()'); 32 $response = new myWebResponse($dispatcher, array('charset' => 'ISO-8859-1')); 33 $t->is($response->getContentType(), 'text/html; charset=ISO-8859-1', '->initialize() takes a "charset" option'); 34 $response = new myWebResponse($dispatcher, array('content_type' => 'text/plain')); 35 $t->is($response->getContentType(), 'text/plain; charset=utf-8', '->initialize() takes a "content_type" option'); 29 36 30 37 $response = new myWebResponse($dispatcher); … … 98 105 $t->diag('->getContentType() ->setContentType()'); 99 106 107 $response = new myWebResponse($dispatcher); 100 108 $t->is($response->getContentType(), 'text/html; charset=utf-8', '->getContentType() returns a sensible default value'); 101 109

