Commit 68758d97 authored by Igor Wiedler's avatar Igor Wiedler

add a crawler test for WebTestCase

parent fcbd132c
...@@ -27,6 +27,9 @@ class WebTestCaseTest extends WebTestCase ...@@ -27,6 +27,9 @@ class WebTestCaseTest extends WebTestCase
'/hello' => function() { '/hello' => function() {
return 'world'; return 'world';
}, },
'/html' => function() {
return '<h1>title</h1>';
},
)); ));
return $app; return $app;
...@@ -41,4 +44,12 @@ class WebTestCaseTest extends WebTestCase ...@@ -41,4 +44,12 @@ class WebTestCaseTest extends WebTestCase
$this->assertTrue($response->isSuccessful()); $this->assertTrue($response->isSuccessful());
$this->assertEquals('world', $response->getContent()); $this->assertEquals('world', $response->getContent());
} }
public function testCrawlerFilter()
{
$client = $this->createClient();
$crawler = $client->request('GET', '/html');
$this->assertEquals('title', $crawler->filter('h1')->text());
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment