File tree 3 files changed +26
-1
lines changed
3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ method::
117
117
'The name of the bundle should be suffixed with \'Bundle\''
118
118
);
119
119
}
120
+
120
121
return $answer;
121
122
},
122
123
false,
@@ -156,9 +157,11 @@ You can also ask and validate a hidden response::
156
157
$dialog = $this->getHelperSet()->get('dialog');
157
158
158
159
$validator = function ($value) {
159
- if (trim($value) == '' ) {
160
+ if ('' === trim($value)) {
160
161
throw new \Exception('The password can not be empty');
161
162
}
163
+
164
+ return $value;
162
165
};
163
166
164
167
$password = $dialog->askHiddenResponseAndValidate(
Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ object-oriented interface using a variety of session storage drivers.
12
12
Sessions are used via the simple :class: `Symfony\\ Component\\ HttpFoundation\\ Session\\ Session `
13
13
implementation of :class: `Symfony\\ Component\\ HttpFoundation\\ Session\\ SessionInterface ` interface.
14
14
15
+ .. caution ::
16
+
17
+ Make sure your PHP session isn't already started before using the Session
18
+ class. If you have a legacy session system that starts your session, see
19
+ http://symfony.com/doc/current/components/http_foundation/session_php_bridge.html
20
+
15
21
Quick example::
16
22
17
23
use Symfony\Component\HttpFoundation\Session\Session;
Original file line number Diff line number Diff line change @@ -282,3 +282,19 @@ You can also set the host option on imported routes:
282
282
283
283
The host ``hello.example.com `` will be set on each route loaded from the new
284
284
routing resource.
285
+
286
+ Testing your Controllers
287
+ ------------------------
288
+
289
+ You need to set the Host HTTP header on your request objects if you want to get
290
+ past url matching in your functional tests.
291
+
292
+ .. code-block :: php
293
+
294
+ $crawler = $client->request(
295
+ 'GET',
296
+ '/homepage',
297
+ array(),
298
+ array(),
299
+ array('HTTP_HOST' => 'm.' . $client->getContainer()->getParameter('domain'))
300
+ );
You can’t perform that action at this time.
0 commit comments