Skip to content

Commit c27c0cf

Browse files
committed
Merge branch '4.1'
* 4.1: [testing] tell about self::$container Fix typo in the Twig article Removed some whitespace Reworded the tip contents Add Tip to using MailHog during developement Added a small note about dynamic role hierarchies Added a note about command aliases and services
2 parents b8a7564 + 339cb7c commit c27c0cf

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

console/commands_as_services.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ Or set the ``command`` attribute on the ``console.command`` tag in your service
119119
->addTag('console.command', array('command' => 'app:sunshine'))
120120
;
121121
122+
.. note::
123+
124+
If the command defines aliases (using the
125+
:method:`Symfony\\Component\\Console\\Command\\Command::getAliases` method)
126+
you must add one ``console.command`` tag per alias.
127+
122128
That's it. One way or another, the ``SunshineCommand`` will be instantiated
123129
only when the ``app:sunshine`` command is actually called.
124130

email/dev_environment.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,12 @@ the report with details of the sent emails.
241241
by the submit URL used on the previous request (e.g. ``/contact/handle``).
242242
The profiler's search feature allows you to load the profiler information
243243
for any past requests.
244+
245+
.. tip::
246+
247+
In addition to the features provided by Symfony, there are applications that
248+
can help you test emails during application development, like `MailCatcher`_
249+
and `MailHog`_.
250+
251+
.. _`MailCatcher`: https://github.com/sj26/mailcatcher
252+
.. _`MailHog`: https://github.com/mailhog/MailHog

reference/configuration/twig.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ format
129129
The format used by the ``date`` filter to display values when no specific format
130130
is passed as argument.
131131

132-
internal_format
132+
interval_format
133133
...............
134134

135135
**type**: ``string`` **default**: ``%d days``

security.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,13 @@ In the above configuration, users with ``ROLE_ADMIN`` role will also have the
12821282
``ROLE_USER`` role. The ``ROLE_SUPER_ADMIN`` role has ``ROLE_ADMIN``, ``ROLE_ALLOWED_TO_SWITCH``
12831283
and ``ROLE_USER`` (inherited from ``ROLE_ADMIN``).
12841284

1285+
.. note::
1286+
1287+
The value of the ``role_hierarchy`` option is defined statically, so you
1288+
can't for example store the role hierarchy in a database. If you need that,
1289+
create a custom :doc:`security voter </security/voters>` that looks for the
1290+
user roles in the database.
1291+
12851292
Final Words
12861293
-----------
12871294

testing.rst

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,18 +508,28 @@ You can also get the objects related to the latest request::
508508
Accessing the Container
509509
~~~~~~~~~~~~~~~~~~~~~~~
510510

511+
.. versionadded:: 4.1
512+
The ``self::$container`` property was introduced in Symfony 4.1.
513+
511514
It's highly recommended that a functional test only tests the response. But
512-
under certain very rare circumstances, you might want to access some internal
513-
objects to write assertions. In such cases, you can access the Dependency
514-
Injection Container::
515+
under certain very rare circumstances, you might want to access some services
516+
to write assertions. Given that services are private by default, test classes
517+
define a property that stores a special container created by Symfony which
518+
allows fetching both public and all non-removed private services::
515519

516-
// will be the same container used in your test, unless you're using
520+
// gives access to the same services used in your test, unless you're using
517521
// $client->insulate() or using real HTTP requests to test your application
518-
$container = $client->getContainer();
522+
$container = self::$container;
519523

520524
For a list of services available in your application, use the ``debug:container``
521525
command.
522526

527+
.. tip::
528+
529+
The special container that gives access to private services exists only in
530+
the ``test`` environment and is itself a service that you can get from the
531+
real container using the ``test.service_container`` id.
532+
523533
.. tip::
524534

525535
If the information you need to check is available from the profiler, use

0 commit comments

Comments
 (0)