SimpleBrowser::back PHP Method

back() public method

The browser history is unchanged on failure. The page content is refetched as there is no concept of content caching in SimpleTest.
public back ( ) : boolean
return boolean True if history entry and fetch succeeded
    public function back()
    {
        if (!$this->history->back()) {
            return false;
        }
        $content = $this->retry();
        if (!$content) {
            $this->history->forward();
        }
        return $content;
    }

Usage Example

Example #1
0
 function testBack()
 {
     $browser4 = new SimpleBrowser();
     $browser4->get("http://www.google.com/");
     $browser4->get("http://www.yahoo.com/");
     $browser4->back();
     $browser4->getTitle();
     $this->assertEqual($browser4->getTitle(), 'Google');
 }