@@ -29,25 +29,27 @@ Requesting a Page
2929Essentially, feature tests simply allows you to call an endpoint on your application and get the results back.
3030To do this, you use the ``call() `` method.
3131
32- 1. The first parameter is the HTTP method to use (most frequently either GET or POST).
32+ 1. The first parameter is the HTTP method to use (most frequently either `` GET `` or `` POST `` ).
33332. The second parameter is the URI path on your site to test.
34343. The third parameter ``$params `` accepts an array that is used to populate the
3535 superglobal variables for the HTTP verb you are using. So, a method of **GET **
36- would have the ** $_GET ** variable populated, while a **POST ** request would
37- have the ** $_POST ** array populated. The ``$params `` is also used in
36+ would have the `` $_GET `` variable populated, while a **POST ** request would
37+ have the `` $_POST `` array populated. The ``$params `` is also used in
3838 :ref: `feature-formatting-the-request `.
3939
4040 .. note :: The ``$params`` array does not make sense for every HTTP verb, but is
4141 included for consistency.
4242
4343.. literalinclude :: feature/002.php
44+ :lines: 2-
4445
4546Shorthand Methods
4647-----------------
4748
4849Shorthand methods for each of the HTTP verbs exist to ease typing and make things clearer:
4950
5051.. literalinclude :: feature/003.php
52+ :lines: 2-
5153
5254Setting Different Routes
5355------------------------
@@ -56,6 +58,7 @@ You can use a custom collection of routes by passing an array of "routes" into t
5658override any existing routes in the system:
5759
5860.. literalinclude :: feature/004.php
61+ :lines: 2-
5962
6063Each of the "routes" is a 3 element array containing the HTTP verb (or "add" for all),
6164the URI to match, and the routing destination.
@@ -68,6 +71,7 @@ of key/value pairs that should exist within the ``$_SESSION`` variable when this
6871that the current values of ``$_SESSION `` should be used. This is handy for testing authentication and more.
6972
7073.. literalinclude :: feature/005.php
74+ :lines: 2-
7175
7276Setting Headers
7377---------------
@@ -76,6 +80,7 @@ You can set header values with the ``withHeaders()`` method. This takes an array
7680passed as a header into the call:
7781
7882.. literalinclude :: feature/006.php
83+ :lines: 2-
7984
8085Bypassing Events
8186----------------
@@ -84,6 +89,7 @@ Events are handy to use in your application, but can be problematic during testi
8489to send out emails. You can tell the system to skip any event handling with the ``skipEvents() `` method:
8590
8691.. literalinclude :: feature/007.php
92+ :lines: 2-
8793
8894.. _feature-formatting-the-request :
8995
@@ -100,6 +106,7 @@ body of the request in the given format.
100106This will also set the `Content-Type ` header for your request accordingly.
101107
102108.. literalinclude :: feature/008.php
109+ :lines: 2-
103110
104111.. _feature-setting-the-body :
105112
0 commit comments