Skip to content

Commit 151fde9

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents e340267 + 3dae7e3 commit 151fde9

File tree

17 files changed

+242
-74
lines changed

17 files changed

+242
-74
lines changed

book/controller.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ to ``$name``. Just make sure they the name of the placeholder is the
260260
same as the name of the argument variable.
261261

262262
Take the following more-interesting example, where the controller has two
263-
arguments::
263+
arguments:
264264

265265
.. configuration-block::
266266

@@ -681,7 +681,7 @@ read any flash messages from the session:
681681

682682
.. code-block:: html+twig
683683

684-
{% for flash_message in app.session.flashbag.get('notice') %}
684+
{% for flash_message in app.session.flashBag.get('notice') %}
685685
<div class="flash-notice">
686686
{{ flash_message }}
687687
</div>
@@ -714,7 +714,7 @@ The Request and Response Object
714714
-------------------------------
715715

716716
As mentioned :ref:`earlier <book-controller-request-argument>`, the framework will
717-
pass the ``Request`` object to any controller argument taht is type-hinted with
717+
pass the ``Request`` object to any controller argument that is type-hinted with
718718
the ``Request`` class::
719719

720720
use Symfony\Component\HttpFoundation\Request;

book/doctrine.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ can automatically generate an empty ``test_project`` database for you:
150150
151151
# app/config/config.yml
152152
doctrine:
153-
charset: utf8mb4
154153
dbal:
154+
charset: utf8mb4
155155
default_table_options:
156156
charset: utf8mb4
157157
collate: utf8mb4_unicode_ci

book/forms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ the documentation for each type.
662662
:ref:`disable HTML5 validation <book-forms-html5-validation-disable>`
663663
or set the ``required`` option on your field to ``false``::
664664
665-
->add('dueDate', 'date', array(
665+
->add('dueDate', DateType::class, array(
666666
'widget' => 'single_text',
667667
'required' => false
668668
))

book/http_cache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ Here is how you can configure the Symfony reverse proxy to support the
917917
if ($this->getStore()->purge($request->getUri())) {
918918
$response->setStatusCode(200, 'Purged');
919919
} else {
920-
$response->setStatusCode(200, 'Not found');
920+
$response->setStatusCode(404, 'Not found');
921921
}
922922

923923
return $response;

changelog.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,82 @@ documentation.
1313
Do you also want to participate in the Symfony Documentation? Take a look
1414
at the ":doc:`/contributing/documentation/overview`" article.
1515

16+
March, 2016
17+
-----------
18+
19+
New Documentation
20+
~~~~~~~~~~~~~~~~~
21+
22+
* `#6274 <https://github.com/symfony/symfony-docs/pull/6274>`_ Update Doctrine UTF8 docs (mcfedr)
23+
* `#6314 <https://github.com/symfony/symfony-docs/pull/6314>`_ New normalizers (mcfedr)
24+
* `#4971 <https://github.com/symfony/symfony-docs/pull/4971>`_ [DomCrawler] Document images crawler (valeriangalliat)
25+
* `#6296 <https://github.com/symfony/symfony-docs/pull/6296>`_ [Console] Add columns width setter documentation (akeeman)
26+
* `#6282 <https://github.com/symfony/symfony-docs/pull/6282>`_ [Form] fix ``choice_label`` values (HeahDude)
27+
* `#5894 <https://github.com/symfony/symfony-docs/pull/5894>`_ [WIP] Added an article to explain how to upgrade third-party bundles to Symfony 3 (javiereguiluz)
28+
* `#6273 <https://github.com/symfony/symfony-docs/pull/6273>`_ [PHPUnit bridge] Add documentation for the component (theofidry)
29+
* `#6316 <https://github.com/symfony/symfony-docs/pull/6316>`_ [Validator] Added docs about the format option (dosten)
30+
* `#6291 <https://github.com/symfony/symfony-docs/pull/6291>`_ fortrabbit deployment guide + index listing (ostark)
31+
32+
Fixed Documentation
33+
~~~~~~~~~~~~~~~~~~~
34+
35+
* `#6377 <https://github.com/symfony/symfony-docs/pull/6377>`_ Update "bootstrap.php.cache" to "autoload.php" (guilliamxavier)
36+
* `#6368 <https://github.com/symfony/symfony-docs/pull/6368>`_ [cookbook] Made list of form types more consistent (AAstakhov)
37+
* `#6366 <https://github.com/symfony/symfony-docs/pull/6366>`_ Removed server:stop code block for 2.3 (theyoux)
38+
* `#6347 <https://github.com/symfony/symfony-docs/pull/6347>`_ Add a note about enabling DebugBundle to use VarDumper inside Symfony (martijn80, javiereguiluz)
39+
* `#6320 <https://github.com/symfony/symfony-docs/pull/6320>`_ Fixed typo in path (timhovius)
40+
* `#6334 <https://github.com/symfony/symfony-docs/pull/6334>`_ Fixed yaml configuration of app.exception_controller (AAstakhov)
41+
* `#6322 <https://github.com/symfony/symfony-docs/pull/6322>`_ [DependencyInjection] fix autowiring docs (eXtreme)
42+
* `#6315 <https://github.com/symfony/symfony-docs/pull/6315>`_ Remove third parameter from createFormBuilder call (Hocdoc)
43+
* `#6324 <https://github.com/symfony/symfony-docs/pull/6324>`_ Fixed UserCheckerInterface importing (VIs-a-vis)
44+
* `#6326 <https://github.com/symfony/symfony-docs/pull/6326>`_ Missing svn:ignore (f-plante)
45+
46+
Minor Documentation Changes
47+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
48+
49+
* `#6404 <https://github.com/symfony/symfony-docs/pull/6404>`_ fixed a typo (RickieL)
50+
* `#6409 <https://github.com/symfony/symfony-docs/pull/6409>`_ Update 'date' to DateType::class in form.rst (iltar)
51+
* `#6411 <https://github.com/symfony/symfony-docs/pull/6411>`_ Fixed a typo in configuration-block (VarunAgw)
52+
* `#6414 <https://github.com/symfony/symfony-docs/pull/6414>`_ stick to Sphinx 1.3.x for the moment (xabbuh)
53+
* `#6399 <https://github.com/symfony/symfony-docs/pull/6399>`_ Fixed wrong code examples for Isbn constraint (AAstakhov)
54+
* `#6397 <https://github.com/symfony/symfony-docs/pull/6397>`_ Fix typo in SwitchUserListener file name (luxifer)
55+
* `#6390 <https://github.com/symfony/symfony-docs/pull/6390>`_ Reworded the example about $deep param (Oliboy50, javiereguiluz)
56+
* `#6381 <https://github.com/symfony/symfony-docs/pull/6381>`_ [Form] [Cookbook] Correctly setup unit tests with dependencies (corphi)
57+
* `#6382 <https://github.com/symfony/symfony-docs/pull/6382>`_ unused use instructions (bshevchenko)
58+
* `#6365 <https://github.com/symfony/symfony-docs/pull/6365>`_ Removed the PR table example (this is now included by GitHub template) (javiereguiluz)
59+
* `#6363 <https://github.com/symfony/symfony-docs/pull/6363>`_ Removed info about reducing visibility for private (AAstakhov)
60+
* `#6362 <https://github.com/symfony/symfony-docs/pull/6362>`_ [book] Updated link to Translatable Extension (AAstakhov)
61+
* `#6336 <https://github.com/symfony/symfony-docs/pull/6336>`_ Added minor clarification (ThomasLandauer)
62+
* `#6303 <https://github.com/symfony/symfony-docs/pull/6303>`_ Tweaked the Symfony Releases page (javiereguiluz)
63+
* `#6360 <https://github.com/symfony/symfony-docs/pull/6360>`_ Editing the Doctrine section to improve accuracy and readability (natechicago)
64+
* `#6352 <https://github.com/symfony/symfony-docs/pull/6352>`_ [book] controller ch review, part 3 (Talita Kocjan Zager)
65+
* `#6351 <https://github.com/symfony/symfony-docs/pull/6351>`_ [book] controller ch review, part 2 (Talita Kocjan Zager)
66+
* `#6349 <https://github.com/symfony/symfony-docs/pull/6349>`_ [book] controller ch review, part 1 (Talita Kocjan Zager)
67+
* `#6369 <https://github.com/symfony/symfony-docs/pull/6369>`_ Minor corrections (sfdumi)
68+
* `#6370 <https://github.com/symfony/symfony-docs/pull/6370>`_ Fixed typo (tabbi89)
69+
* `#6371 <https://github.com/symfony/symfony-docs/pull/6371>`_ Fix escaping of backtick inside double back-quotes (guilliamxavier)
70+
* `#6364 <https://github.com/symfony/symfony-docs/pull/6364>`_ [reference] [constraints] added missing colon character for Image constraint documentation in YAML format. (hhamon)
71+
* `#6345 <https://github.com/symfony/symfony-docs/pull/6345>`_ Remove link-local IPv6 address (snoek09)
72+
* `#6219 <https://github.com/symfony/symfony-docs/pull/6219>`_ Point that route parameters are also Request attributes (sfdumi)
73+
* `#6348 <https://github.com/symfony/symfony-docs/pull/6348>`_ [best practices] mostly typos (Talita Kocjan Zager)
74+
* `#6350 <https://github.com/symfony/symfony-docs/pull/6350>`_ Fix reference to app folder (kainjow)
75+
* `#6275 <https://github.com/symfony/symfony-docs/pull/6275>`_ [quick tour] mostly typos (Talita Kocjan Zager)
76+
* `#6305 <https://github.com/symfony/symfony-docs/pull/6305>`_ Mention IvoryCKEditorBundle in the Symfony Forms doc (javiereguiluz)
77+
* `#6331 <https://github.com/symfony/symfony-docs/pull/6331>`_ Rename DunglasApiBundle to ApiPlatform (sroze)
78+
* `#6328 <https://github.com/symfony/symfony-docs/pull/6328>`_ Update extension.rst - added caution box for people trying to remove the default file with services definitions (Pavel Jurecka)
79+
* `#6343 <https://github.com/symfony/symfony-docs/pull/6343>`_ Replace XLIFF number ids by strings (Triiistan)
80+
* `#6344 <https://github.com/symfony/symfony-docs/pull/6344>`_ Altered single / multiple inheritance sentence (outspaced)
81+
* `#6330 <https://github.com/symfony/symfony-docs/pull/6330>`_ [Form] reorder EntityType options (HeahDude)
82+
* `#6337 <https://github.com/symfony/symfony-docs/pull/6337>`_ Fix configuration.rst typo (gong023)
83+
* `#6295 <https://github.com/symfony/symfony-docs/pull/6295>`_ Update tools.rst (andrewtch)
84+
* `#6323 <https://github.com/symfony/symfony-docs/pull/6323>`_ [DependencyInjection] Add Autowiring keyword (theofidry)
85+
* `#6325 <https://github.com/symfony/symfony-docs/pull/6325>`_ Minor error (ThomasLandauer)
86+
* `#6311 <https://github.com/symfony/symfony-docs/pull/6311>`_ Improved TwigExtension to show default values and optional arguments (javiereguiluz)
87+
* `#6286 <https://github.com/symfony/symfony-docs/pull/6286>`_ [HttpFoundation] Fix typo for ParameterBag getters - 3.0 (rendler-denis)
88+
* `#6267 <https://github.com/symfony/symfony-docs/pull/6267>`_ [Form] fix 'data_class' option in EntityType (HeahDude)
89+
* `#6281 <https://github.com/symfony/symfony-docs/pull/6281>`_ Change isValid to isSubmitted. (mustafaaloko)
90+
91+
1692
February, 2016
1793
--------------
1894

components/form/introduction.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,8 @@ Your integration with the Validation component will look something like this::
315315
use Symfony\Component\Validator\Validation;
316316

317317
$vendorDir = realpath(__DIR__.'/../vendor');
318-
$vendorFormDir = $vendorDir.'/symfony/form/Symfony/Component/Form';
319-
$vendorValidatorDir =
320-
$vendorDir.'/symfony/validator/Symfony/Component/Validator';
318+
$vendorFormDir = $vendorDir.'/symfony/form';
319+
$vendorValidatorDir = $vendorDir.'/symfony/validator';
321320

322321
// create the validator - details will vary
323322
$validator = Validation::createValidator();

components/phpunit_bridge.rst

Lines changed: 96 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ message contains the ``"foobar"`` string.
114114
Making Tests Fail
115115
-----------------
116116

117-
By default, any non-legacy-tagged or any non-`@-silenced`_ deprecation notices will
118-
make tests fail. Alternatively, setting ``SYMFONY_DEPRECATIONS_HELPER`` to an
119-
arbitrary value (ex: ``320``) will make the tests fails only if a higher number
120-
of deprecation notices is reached (``0`` is the default value). You can also set
121-
the value ``"weak"`` which will make the bridge ignore any deprecation notices.
122-
This is useful to projects that must use deprecated interfaces for backward
123-
compatibility reasons.
117+
By default, any non-legacy-tagged or any non-`@-silenced`_ deprecation notices
118+
will make tests fail. Alternatively, setting ``SYMFONY_DEPRECATIONS_HELPER`` to
119+
an arbitrary value (ex: ``320``) will make the tests fails only if a higher
120+
number of deprecation notices is reached (``0`` is the default value). You can
121+
also set the value ``"weak"`` which will make the bridge ignore any deprecation
122+
notices. This is useful to projects that must use deprecated interfaces for
123+
backward compatibility reasons.
124124

125125
Time-sensitive Tests
126126
--------------------
@@ -171,7 +171,7 @@ To use the ``ClockMock`` class in your test, you can:
171171
``ClockMock::withClockMock(true)`` before the test and
172172
``ClockMock::withClockMock(false)`` after the test.
173173

174-
As a result, the following is guarenteed to work and is no longer a transient
174+
As a result, the following is guaranteed to work and is no longer a transient
175175
test::
176176

177177
use Symfony\Component\Stopwatch\Stopwatch;
@@ -203,17 +203,97 @@ And that's all!
203203
advances the internal clock the given number of seconds without actually
204204
waiting that time, so your test will execute 10 seconds faster.
205205

206+
DNS-sensitive Tests
207+
-------------------
208+
209+
.. versionadded:: 3.1
210+
The mocks for DNS related functions were introduced in Symfony 3.1.
211+
212+
Tests that make network connections, for example to check the validity of a DNS
213+
record, can be slow to execute and unreliable due to the conditions of the
214+
network. For that reason, this component also provides mocks for these PHP
215+
functions:
216+
217+
* :phpfunction:`checkdnsrr()`
218+
* :phpfunction:`dns_check_record()`
219+
* :phpfunction:`getmxrr()`
220+
* :phpfunction:`dns_get_mx()`
221+
* :phpfunction:`gethostbyaddr()`
222+
* :phpfunction:`gethostbyname()`
223+
* :phpfunction:`gethostbynamel()`
224+
* :phpfunction:`dns_get_record()`
225+
226+
Use Case
227+
~~~~~~~~
228+
229+
Consider the following example that uses the ``checkMX`` option of the ``Email``
230+
constraint to test the validity of the email domain::
231+
232+
use Symfony\Component\Validator\Constraints\Email;
233+
234+
class MyTest extends \PHPUnit_Framework_TestCase
235+
{
236+
public function testEmail()
237+
{
238+
$validator = ...
239+
$constraint = new Email(array('checkMX' => true));
240+
241+
$result = $validator->validate('foo@example.com', $constraint);
242+
243+
// ...
244+
}
245+
246+
In order to avoid making a real network connection, add the ``@dns-sensitive``
247+
annotation to the class and use the ``DnsMock::withMockedHosts()`` to configure
248+
the data you expect to get for the given hosts::
249+
250+
use Symfony\Component\Validator\Constraints\Email;
251+
252+
/**
253+
* @group dns-sensitive
254+
*/
255+
class MyTest extends \PHPUnit_Framework_TestCase
256+
{
257+
public function testEmails()
258+
{
259+
DnsMock::withMockedHosts(array('example.com' => array(array('type' => 'MX'))));
260+
261+
$validator = ...
262+
$constraint = new Email(array('checkMX' => true));
263+
264+
$result = $validator->validate('foo@example.com', $constraint);
265+
266+
// ...
267+
}
268+
269+
The ``withMockedHosts()`` method can return any number of hosts with different
270+
configuration, so you can simulate diverse network conditions::
271+
272+
DnsMock::withMockedHosts(array(
273+
'example.com' => array(
274+
array(
275+
'type' => 'A',
276+
'ip' => '1.2.3.4',
277+
),
278+
array(
279+
'type' => 'AAAA',
280+
'ipv6' => '::12',
281+
),
282+
),
283+
));
284+
206285
Troubleshooting
207-
~~~~~~~~~~~~~~~
286+
---------------
208287

209-
The ``@group time-sensitive`` works "by convention" and assumes that the
210-
namespace of the tested class can be obtained just by removing the ``\Tests\``
211-
part from the test namespace. I.e. that if the your test case fully-qualified
212-
class name (FQCN) is ``App\Tests\Watch\DummyWatchTest``, it assumes the tested
213-
class FQCN is ``App\Watch\DummyWatch``.
288+
The ``@group time-sensitive`` and ``@group dns-sensitive`` annotations work
289+
"by convention" and assume that the namespace of the tested class can be
290+
obtained just by removing the ``\Tests\`` part from the test namespace. For
291+
example, if your test case fully-qualified class name (FQCN) is
292+
``App\Tests\Watch\DummyWatchTest``, it assumes the tested class FQCN is
293+
``App\Watch\DummyWatch``.
214294

215-
If this convention doesn't work for your application, you can also configure
216-
the mocked namespaces in the ``phpunit.xml`` file, as done for example in the
295+
If this convention doesn't work for your application, configure the mocked
296+
namespaces in the ``phpunit.xml`` file, as done for example in the
217297
:doc:`HttpKernel Component </components/http_kernel/introduction>`:
218298

219299
.. code-block:: xml

components/serializer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ You are now able to serialize only attributes in the groups you want::
296296
$serializer = new Serializer(array($normalizer));
297297

298298
$data = $serializer->normalize($obj, null, array('groups' => array('group1')));
299-
// $data = ['foo' => 'foo'];
299+
// $data = array('foo' => 'foo');
300300

301301
$obj2 = $serializer->denormalize(
302302
array('foo' => 'foo', 'bar' => 'bar'),

contributing/code/core_team.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ Active Core Members
5151
* **Romain Neutron** (`romainneutron`_) can merge into the
5252
Process_ component;
5353

54-
* **Nicolas Grekas** (`nicolas-grekas`_) can merge into the Debug_
55-
component, the VarDumper_ component and the DebugBundle_;
54+
* **Nicolas Grekas** (`nicolas-grekas`_) can merge into the Cache_, Debug_,
55+
Process_, PropertyAccess_, VarDumper_ components, PhpUnitBridge_ and
56+
the DebugBundle_;
5657

5758
* **Christophe Coevoet** (`stof`_) can merge into the BrowserKit_,
5859
Config_, Console_, DependencyInjection_, DomCrawler_, EventDispatcher_,

0 commit comments

Comments
 (0)