namespace Symfony\Component\BrowserKit\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\BrowserKit\History;
use Symfony\Component\BrowserKit\Request;
class HistoryTest extends TestCase
{ 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'
);