Skip to content

Commit 4d8c866

Browse files
committed
Merge branch '2.8' into 3.4
* 2.8: Improve functional test workflow example Added documentation about authentication for multiple firewalls under the same firewall context Fix missing use of IssueSelectorType Fixed URLs to APIs outside of the Symfony project
2 parents 0e66933 + ee910bb commit 4d8c866

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

components/psr7.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ that builds objects implementing PSR-7 interfaces from HttpFoundation objects.
3636
It also provide a default implementation using Zend Diactoros internally.
3737

3838
The following code snippet explain how to convert a :class:`Symfony\\Component\\HttpFoundation\\Request`
39-
to a Zend Diactoros :class:`Zend\\Diactoros\\ServerRequest` implementing the
40-
:class:`Psr\\Http\\Message\\ServerRequestInterface` interface::
39+
to a ``Zend\\Diactoros\\ServerRequest`` class implementing the
40+
``Psr\\Http\\Message\\ServerRequestInterface`` interface::
4141

4242
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
4343
use Symfony\Component\HttpFoundation\Request;
@@ -48,9 +48,9 @@ to a Zend Diactoros :class:`Zend\\Diactoros\\ServerRequest` implementing the
4848
$psr7Factory = new DiactorosFactory();
4949
$psrRequest = $psr7Factory->createRequest($symfonyRequest);
5050

51-
And now from a :class:`Symfony\\Component\\HttpFoundation\\Response` to a Zend
52-
Diactoros :class:`Zend\\Diactoros\\Response` implementing the :class:`Psr\\Http\\Message\\ResponseInterface`
53-
interface::
51+
And now from a :class:`Symfony\\Component\\HttpFoundation\\Response` to a
52+
``Zend\\Diactoros\\Response`` class implementing the
53+
``Psr\\Http\\Message\\ResponseInterface`` interface::
5454

5555
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
5656
use Symfony\Component\HttpFoundation\Response;
@@ -68,8 +68,8 @@ On the other hand, the bridge provide a factory interface called
6868
that builds HttpFoundation objects from objects implementing PSR-7 interfaces.
6969

7070
The next snippet explain how to convert an object implementing the
71-
:class:`Psr\\Http\\Message\\ServerRequestInterface`
72-
interface to a :class:`Symfony\\Component\\HttpFoundation\\Request` instance::
71+
``Psr\\Http\\Message\\ServerRequestInterface`` interface to a
72+
:class:`Symfony\\Component\\HttpFoundation\\Request` instance::
7373

7474
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
7575

@@ -78,7 +78,7 @@ interface to a :class:`Symfony\\Component\\HttpFoundation\\Request` instance::
7878
$httpFoundationFactory = new HttpFoundationFactory();
7979
$symfonyRequest = $httpFoundationFactory->createRequest($psrRequest);
8080

81-
From an object implementing the :class:`Psr\\Http\\Message\\ResponseInterface`
81+
From an object implementing the ``Psr\\Http\\Message\\ResponseInterface``
8282
to a :class:`Symfony\\Component\\HttpFoundation\\Response` instance::
8383

8484
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;

form/data_transformers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ As long as you're using :ref:`autowire <services-autowire>` and
377377
// src/AppBundle/Form/Type/TaskType.php
378378
namespace AppBundle\Form\Type;
379379

380-
use AppBundle\Form\DataTransformer\IssueToNumberTransformer;
380+
use AppBundle\Form\IssueSelectorType;
381381
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
382382
// ...
383383

testing.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ application (from the routing to the views). They are no different from unit
123123
tests as far as PHPUnit is concerned, but they have a very specific workflow:
124124

125125
* Make a request;
126-
* Test the response;
127126
* Click on a link or submit a form;
128127
* Test the response;
129128
* Rinse and repeat.

testing/http_authentication.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ needs::
113113
{
114114
$session = $this->client->getContainer()->get('session');
115115

116-
// the firewall context defaults to the firewall name
116+
$firewallName = 'secure_area';
117+
// if you don't define multiple connected firewalls, the context defaults to the firewall name
118+
// See https://symfony.com/doc/current/reference/configuration/security.html#firewall-context
117119
$firewallContext = 'secured_area';
118120

119-
$token = new UsernamePasswordToken('admin', null, $firewallContext, array('ROLE_ADMIN'));
121+
$token = new UsernamePasswordToken('admin', null, $firewallName, array('ROLE_ADMIN'));
120122
$session->set('_security_'.$firewallContext, serialize($token));
121123
$session->save();
122124

0 commit comments

Comments
 (0)