예제 #1
0
 public function testClickForm()
 {
     $client = new TestClient();
     $client->setNextResponse(new Response('<html><form action="/foo"><input type="submit" /></form></html>'));
     $crawler = $client->request('GET', 'http://www.example.com/foo/foobar');
     $client->click($crawler->filter('input')->form());
     $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->click() Form submit forms');
 }
예제 #2
0
    public function testClickForm()
    {
        if (!class_exists('Symfony\Component\DomCrawler\Crawler')) {
            $this->markTestSkipped('The "DomCrawler" component is not available');
        }

        if (!class_exists('Symfony\Component\CssSelector\CssSelector')) {
            $this->markTestSkipped('The "CssSelector" component is not available');
        }

        $client = new TestClient();
        $client->setNextResponse(new Response('<html><form action="/foo"><input type="submit" /></form></html>'));
        $crawler = $client->request('GET', 'http://www.example.com/foo/foobar');

        $client->click($crawler->filter('input')->form());

        $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->click() Form submit forms');
    }