public function testAdd() { $history =
new History();
$history->
add(new Request('http://www.example1.com/', 'get'
));
$this->
assertSame('http://www.example1.com/',
$history->
current()->
getUri(), '->add() adds a request to the history'
);
$history->
add(new Request('http://www.example2.com/', 'get'
));
$this->
assertSame('http://www.example2.com/',
$history->
current()->
getUri(), '->add() adds a request to the history'
);
$history->
add(new Request('http://www.example3.com/', 'get'
));
$history->
back();
$history->
add(new Request('http://www.example4.com/', 'get'
));
$this->
assertSame('http://www.example4.com/',
$history->
current()->
getUri(), '->add() adds a request to the history'
);
$history->
back();
$this->
assertSame('http://www.example2.com/',
$history->
current()->
getUri(), '->add() adds a request to the history'
);
} public function testClearIsEmpty() { $history =
new History();
$history->
add(new Request('http://www.example.com/', 'get'
));