Skip to content

Update best_practices.rst #13949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Configuration
Use Environment Variables for Infrastructure Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

These are the options that change from one machine to another (e.g. from your
These are the options that their values changes from one machine to another (e.g. from your
development machine to the production server) but which don't change the
application behavior.

Expand All @@ -92,7 +92,7 @@ Use Secret for Sensitive Information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When your application has sensitive configuration - like an API key - you should
store those securely via :doc:`secrets </configuration/secrets>`.
store those securely via :doc:`Symfony’s secrets management system </configuration/secrets>`.

Use Parameters for Application Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -430,19 +430,19 @@ functional test that checks that all application URLs load successfully::
}

Add this test while creating your application because it requires little effort
and checks that none of your pages returns an error. Later you'll add more
and checks that none of your pages returns an error. Later, you'll add more
specific tests for each page.

Hardcode URLs in a Functional Test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In Symfony applications it's recommended to :ref:`generate URLs <routing-generating-urls>`
In Symfony applications, it's recommended to :ref:`generate URLs <routing-generating-urls>`
using routes to automatically update all links when a URL changes. However, if a
public URL changes, users won't be able to browse it unless you set up a
redirection to the new URL.

That's why it's recommended to use raw URLs in tests instead of generating them
from routes. Whenever a route changes, tests will break and you'll know that
from routes. Whenever a route changes, tests will fail and you'll know that
you must set up a redirection.

.. _`Symfony Demo`: https://github.com/symfony/demo
Expand Down