File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,9 +9,7 @@ class ExampleTest extends TestCase {
99 */
1010 public function testBasicExample ()
1111 {
12- $ client = $ this ->createClient ();
13-
14- $ crawler = $ client ->request ('GET ' , '/ ' );
12+ $ crawler = $ this ->request ('GET ' , '/ ' );
1513
1614 $ this ->assertCount (1 , $ crawler ->filter ('h1:contains("Hello World!") ' ));
1715 }
Original file line number Diff line number Diff line change 22
33class TestCase extends Silex \WebTestCase {
44
5+ /**
6+ * Setup the test environment.
7+ *
8+ * @return void
9+ */
10+ public function setUp ()
11+ {
12+ $ this ->client = $ this ->createClient ();
13+
14+ parent ::setUp ();
15+ }
16+
17+ /**
18+ * Execute a request against the test client application.
19+ *
20+ * @return Symfony\Component\DomCrawler\Crawler
21+ */
22+ public function request ()
23+ {
24+ $ callable = array ($ this ->client , 'request ' );
25+
26+ return call_user_func_array ($ callable , func_get_args ());
27+ }
28+
529 /**
630 * Creates the application.
731 *
You can’t perform that action at this time.
0 commit comments