Skip to content

Commit 73d44d1

Browse files
committed
Merge branch '2.4' into 2.5
* 2.4: Fixed return value Handle "constraints" option in form unit testing Added the fixes suggested by Ryan Reworded a bit the installation instructions Removed the sidebar and made some minor tweaks Minor fixes and tweaks More tweaks and fixes Removed the first person perspective and other minor fixes Fixed some code formatting More improvements based on reviewers' comments Fixed minor typo Applied all the fixes and suggestions made by reviewers First draft of the bundle installation instructions Update override_dir_structure.rst Cache needs be cleared
2 parents de0e355 + 4f2f54d commit 73d44d1

File tree

3 files changed

+61
-3
lines changed

3 files changed

+61
-3
lines changed

cookbook/bundles/best_practices.rst

+53
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,59 @@ Extensive documentation should also be provided in the
194194
the ``Resources/doc/`` directory; the ``Resources/doc/index.rst`` file is
195195
the only mandatory file and must be the entry point for the documentation.
196196

197+
Installation Instructions
198+
~~~~~~~~~~~~~~~~~~~~~~~~~
199+
200+
In order to ease the installation of third-party bundles, consider using the
201+
following standardized instructions in your ``README.md`` file.
202+
203+
.. code-block:: text
204+
205+
Installation
206+
============
207+
208+
Step 1: Download the Bundle
209+
---------------------------
210+
211+
Open a command console, enter your project directory and execute the
212+
following command to download the latest stable version of this bundle:
213+
214+
```bash
215+
$ composer require <package-name> "~1"
216+
```
217+
218+
This command requires you to have Composer installed globally, as explained
219+
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
220+
of the Composer documentation.
221+
222+
Step 2: Enable the Bundle
223+
-------------------------
224+
225+
Then, enable the bundle by adding the following line in the `app/AppKernel.php`
226+
file of your project:
227+
228+
```php
229+
<?php
230+
// app/AppKernel.php
231+
232+
// ...
233+
234+
public function registerBundles()
235+
{
236+
$bundles = array(
237+
// ...
238+
return new <vendor>\<bundle-name>\<bundle-long-name>(),
239+
);
240+
}
241+
```
242+
243+
This template assumes that your bundle is in its ``1.x`` version. If not, change
244+
the ``"~1"`` installation version accordingly (``"~2"``, ``"~3"``, etc.)
245+
246+
Optionally, you can add more installation steps (*Step 3*, *Step 4*, etc.) to
247+
explain other required installation tasks, such as registering routes or
248+
dumping assets.
249+
197250
Routing
198251
-------
199252

cookbook/configuration/override_dir_structure.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ file:
147147
'read_from' => '%kernel.root_dir%/../../public_html',
148148
));
149149
150-
Now you just need to dump the assets again and your application should
150+
Now you just need to clear the cache and dump the assets again and your application should
151151
work:
152152

153153
.. code-block:: bash
154-
154+
155+
$ php app/console cache:clear --env=prod
155156
$ php app/console assetic:dump --env=prod --no-debug

cookbook/form/unit_testing.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,22 @@ on other extensions. You need add those extensions to the factory object::
177177
use Symfony\Component\Form\Forms;
178178
use Symfony\Component\Form\FormBuilder;
179179
use Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension;
180+
use Symfony\Component\Validator\ConstraintViolationList;
180181

181182
class TestedTypeTest extends TypeTestCase
182183
{
183184
protected function setUp()
184185
{
185186
parent::setUp();
187+
188+
$validator = $this->getMock('\Symfony\Component\Validator\ValidatorInterface');
189+
$validator->method('validate')->will($this->returnValue(new ConstraintViolationList()));
186190

187191
$this->factory = Forms::createFormFactoryBuilder()
188192
->addExtensions($this->getExtensions())
189193
->addTypeExtension(
190194
new FormTypeValidatorExtension(
191-
$this->getMock('Symfony\Component\Validator\ValidatorInterface')
195+
$validator
192196
)
193197
)
194198
->addTypeGuesser(

0 commit comments

Comments
 (0)