$this->
assertSame('http://www.example.com/',
$history->
current()->
getUri(), '->back() returns the previous request in the history'
);
} public function testForward() { $history =
new History();
$history->
add(new Request('http://www.example.com/', 'get'
));
$history->
add(new Request('http://www.example1.com/', 'get'
));
try { $history->
forward();
$this->
fail('->forward() throws a \LogicException if the history is already on the last page'
);
} catch (\Exception
$e) { $this->
assertInstanceOf(\LogicException::
class,
$e, '->forward() throws a \LogicException if the history is already on the last page'
);
} $history->
back();
$history->
forward();
$this->
assertSame('http://www.example1.com/',
$history->
current()->
getUri(), '->forward() returns the next request in the history'
);
}}