You are here

public function ClientTest::testClick in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/browser-kit/Tests/ClientTest.php \Symfony\Component\BrowserKit\Tests\ClientTest::testClick()

File

vendor/symfony/browser-kit/Tests/ClientTest.php, line 284

Class

ClientTest

Namespace

Symfony\Component\BrowserKit\Tests

Code

public function testClick() {
  $client = new TestClient();
  $client
    ->setNextResponse(new Response('<html><a href="/foo">foo</a></html>'));
  $crawler = $client
    ->request('GET', 'http://www.example.com/foo/foobar');
  $client
    ->click($crawler
    ->filter('a')
    ->link());
  $this
    ->assertEquals('http://www.example.com/foo', $client
    ->getRequest()
    ->getUri(), '->click() clicks on links');
}