$headers = array('accept-encoding' => 'bzip2'); array_unshift($encodings, 'bzip2'); $target_headers = implode(',', $encodings); $t->like($b->get($dump_headers_url, array(), $headers)->getResponseText(), "/{$target_headers}/", 'it is possible to set supplementary encodings'); /*******************/ /* History methods */ /*******************/ $t->diag('History methods'); $b = new sfWebBrowser(array(), $adapter); $b->get($dump_headers_url); $b->get($dump_headers_url . '?foo=bar'); $b->back(); $t->unlike($b->getResponseText(), '/foo=bar/', 'back() executes again the previous request in the history'); $b->forward(); $t->like($b->getResponseText(), '/foo=bar/', 'forward() executes again the next request in the history'); $b->reload(); $t->like($b->getResponseText(), '/foo=bar/', 'reload() executes again the current request in the history'); /********************/ /* Error management */ /********************/ $t->diag('Error management'); try { $b->get('http://nonexistent'); $t->fail('an exception is thrown when an adapter error occurs'); } catch (Exception $e) { $t->pass('an exception is thrown when an adapter error occurs'); } $t->is($b->get($example_site_url . '/nonexistentpage.html')->responseIsError(), true, 'responseIsError() returns true when response is an error'); $t->is($b->get($example_site_url)->responseIsError(), false, 'responseIsError() returns false when response is not an error'); /*******************/ /* Browser restart */