Skip to content

Commit 1ffb8dc

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: Fix the explanation about registering commands Add a 2nd argument to create() Update http_kernel_httpkernelinterface.rst Fix FQCN in PHP example for expression language Fix FQCN in XML example for expression language
2 parents f89867f + 3f53b03 commit 1ffb8dc

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

create_framework/http_kernel_httpkernelinterface.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ PHP; it implements ``HttpKernelInterface`` and wraps another
5454
``HttpKernelInterface`` instance::
5555

5656
// example.com/web/front.php
57-
$framework = new Simplex\Framework($dispatcher, $matcher, $resolver);
57+
58+
// ..
59+
60+
$framework = new Simplex\Framework($dispatcher, $matcher, $controllerResolver, $argumentResolver);
5861
$framework = new HttpKernel\HttpCache\HttpCache(
5962
$framework,
6063
new HttpKernel\HttpCache\Store(__DIR__.'/../cache')

form/unit_testing.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,19 @@ The simplest ``TypeTestCase`` implementation looks like the following::
4747
'test2' => 'test2',
4848
);
4949

50-
$form = $this->factory->create(TestedType::class);
50+
$objectToCompare = new TestObject();
51+
// $objectToCompare will retrieve data from the form submission; pass it as the second argument
52+
$form = $this->factory->create(TestedType::class, $objectToCompare);
5153

5254
$object = new TestObject();
5355
// ...populate $object properties with the data stored in $formData
5456

5557
// submit the data to the form directly
5658
$form->submit($formData);
5759

60+
$objectToCompare = $form->getData();
5861
$this->assertTrue($form->isSynchronized());
59-
$this->assertEquals($object, $form->getData());
62+
$this->assertEquals($object, $objectToCompare);
6063

6164
$view = $form->createView();
6265
$children = $view->children;
@@ -73,7 +76,7 @@ First you verify if the ``FormType`` compiles. This includes basic class
7376
inheritance, the ``buildForm()`` function and options resolution. This should
7477
be the first test you write::
7578

76-
$form = $this->factory->create(TestedType::class);
79+
$form = $this->factory->create(TestedType::class, $objectToCompare);
7780

7881
This test checks that none of your data transformers used by the form
7982
failed. The :method:`Symfony\\Component\\Form\\FormInterface::isSynchronized`
@@ -91,7 +94,7 @@ method is only set to ``false`` if a data transformer throws an exception::
9194
Next, verify the submission and mapping of the form. The test below
9295
checks if all the fields are correctly specified::
9396

94-
$this->assertEquals($object, $form->getData());
97+
$this->assertEquals($object, $objectToCompare);
9598

9699
Finally, check the creation of the ``FormView``. You should check if all
97100
widgets you want to display are available in the children property::

service_container/expression_language.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ to another service: ``App\Mailer``. One way to do this is with an expression:
4545
<service id="App\Mail\MailerConfiguration"></service>
4646
4747
<service id="App\Mailer">
48-
<argument type="expression">service('App\Mail\MailerConfiguration').getMailerMethod()</argument>
48+
<argument type="expression">service('App\\Mail\\MailerConfiguration').getMailerMethod()</argument>
4949
</service>
5050
</services>
5151
</container>
@@ -60,7 +60,7 @@ to another service: ``App\Mailer``. One way to do this is with an expression:
6060
$container->autowire(MailerConfiguration::class);
6161
6262
$container->autowire(Mailer::class)
63-
->addArgument(new Expression('service("App\Mail\MailerConfiguration").getMailerMethod()'));
63+
->addArgument(new Expression('service("App\\\\Mail\\\\MailerConfiguration").getMailerMethod()'));
6464
6565
To learn more about the expression language syntax, see :doc:`/components/expression_language/syntax`.
6666

0 commit comments

Comments
 (0)