Changeset 4404
- Timestamp:
- 06/26/07 14:26:33 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/lib/test/sfTestBrowser.class.php
r3329 r4404 233 233 public function isResponseHeader($key, $value) 234 234 { 235 $headers = $this->getResponse()->getHttpHeader($key);235 $headers = explode(', ', $this->getResponse()->getHttpHeader($key)); 236 236 237 237 $ok = false; 238 238 239 foreach ($headers as $header) 239 240 { … … 245 246 } 246 247 247 $this->test->ok($ok, sprintf('response header "%s" is "%s" ', $key, $value));248 $this->test->ok($ok, sprintf('response header "%s" is "%s" (%s)', $key, $value, $this->getResponse()->getHttpHeader($key))); 248 249 249 250 return $this; branches/1.0/test/functional/fixtures/project/apps/frontend/modules/browser/actions/actions.class.php
r4293 r4404 19 19 { 20 20 $this->getResponse()->setContentType('text/plain'); 21 21 22 return $this->renderText('text'); 22 23 } 24 25 public function executeResponseHeader() 26 { 27 $response = $this->getResponse(); 28 29 $response->setContentType('text/plain'); 30 $response->setHttpHeader('foo', 'bar', true); 31 $response->setHttpHeader('foo', 'foobar', false); 32 33 return $this->renderText('ok'); 34 } 23 35 } branches/1.0/test/functional/sfTestBrowserTest.php
r4286 r4404 61 61 $b->test()->pass('The DOM is not accessible if the response content type is not HTML'); 62 62 } 63 64 // check response headers 65 $b-> 66 get('/browser/responseHeader')-> 67 isStatusCode()-> 68 isResponseHeader('content-type', 'text/plain; charset=utf-8')-> 69 isResponseHeader('foo', 'bar')-> 70 isResponseHeader('foo', 'foobar') 71 ;