Changeset 4286
- Timestamp:
- 06/20/07 14:07:41 (1 year ago)
- Files:
-
- branches/1.0/CHANGELOG (modified) (1 diff)
- branches/1.0/lib/util/sfBrowser.class.php (modified) (4 diffs)
- branches/1.0/test/functional/sfTestBrowserTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/CHANGELOG
r4285 r4286 4 4 This is a bug fix release. 5 5 6 * r4286: fixed sfBrowser keeps previous Dom is response is not XHTML (#1853) 6 7 * r4282: fixed sfValidatorManager refuses zero values as null values (#1649) 7 8 * r4277: fixed generator themes in the project data directory do not override data in plugin directory (#1813) branches/1.0/lib/util/sfBrowser.class.php
r3334 r4286 208 208 $this->domCssSelector = new sfDomCssSelector($this->dom); 209 209 } 210 else 211 { 212 $this->dom = null; 213 $this->domCssSelector = null; 214 } 210 215 211 216 return $this; … … 246 251 public function getResponseDomCssSelector() 247 252 { 253 if (is_null($this->dom)) 254 { 255 throw new sfException('The DOM is not accessible because the browser response content type is not HMTL.'); 256 } 257 248 258 return $this->domCssSelector; 249 259 } … … 251 261 public function getResponseDom() 252 262 { 263 if (is_null($this->dom)) 264 { 265 throw new sfException('The DOM is not accessible because the browser response content type is not HMTL.'); 266 } 267 253 268 return $this->dom; 254 269 } … … 295 310 public function click($name, $arguments = array()) 296 311 { 297 if (!$this->dom) 312 $dom = $this->getResponseDom(); 313 314 if (!$dom) 298 315 { 299 316 throw new sfException('Cannot click because there is no current page in the browser'); 300 317 } 301 318 302 $xpath = new DomXpath($this->dom); 303 $dom = $this->dom; 319 $xpath = new DomXpath($dom); 304 320 305 321 // text link branches/1.0/test/functional/sfTestBrowserTest.php
r2980 r4286 42 42 throwsException('sfException', 'sfException message') 43 43 ; 44 45 $b-> 46 get('/browser')-> 47 responseContains('html')-> 48 checkResponseElement('h1', 'html')-> 49 50 get('/browser/text')-> 51 responseContains('text') 52 ; 53 54 try 55 { 56 $b->checkResponseElement('h1', 'text'); 57 $b->test()->fail('The DOM is not accessible if the response content type is not HTML'); 58 } 59 catch (sfException $e) 60 { 61 $b->test()->pass('The DOM is not accessible if the response content type is not HTML'); 62 }