Skip to content

Commit

Permalink
Merge branch '2.4' into 2.5
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
weaverryan committed Sep 16, 2014
2 parents de0e355 + 4f2f54d commit 73d44d1
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
53 changes: 53 additions & 0 deletions cookbook/bundles/best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,59 @@ Extensive documentation should also be provided in the
the ``Resources/doc/`` directory; the ``Resources/doc/index.rst`` file is
the only mandatory file and must be the entry point for the documentation.

Installation Instructions
~~~~~~~~~~~~~~~~~~~~~~~~~

In order to ease the installation of third-party bundles, consider using the
following standardized instructions in your ``README.md`` file.

.. code-block:: text
Installation
============
Step 1: Download the Bundle
---------------------------
Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:
```bash
$ composer require <package-name> "~1"
```
This command requires you to have Composer installed globally, as explained
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
of the Composer documentation.
Step 2: Enable the Bundle
-------------------------
Then, enable the bundle by adding the following line in the `app/AppKernel.php`
file of your project:
```php
<?php
// app/AppKernel.php
// ...
public function registerBundles()
{
$bundles = array(
// ...
return new <vendor>\<bundle-name>\<bundle-long-name>(),
);
}
```
This template assumes that your bundle is in its ``1.x`` version. If not, change
the ``"~1"`` installation version accordingly (``"~2"``, ``"~3"``, etc.)

Optionally, you can add more installation steps (*Step 3*, *Step 4*, etc.) to
explain other required installation tasks, such as registering routes or
dumping assets.

Routing
-------

Expand Down
5 changes: 3 additions & 2 deletions cookbook/configuration/override_dir_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ file:
'read_from' => '%kernel.root_dir%/../../public_html',
));
Now you just need to dump the assets again and your application should
Now you just need to clear the cache and dump the assets again and your application should
work:

.. code-block:: bash
$ php app/console cache:clear --env=prod
$ php app/console assetic:dump --env=prod --no-debug
6 changes: 5 additions & 1 deletion cookbook/form/unit_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,22 @@ on other extensions. You need add those extensions to the factory object::
use Symfony\Component\Form\Forms;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\Extension\Validator\Type\FormTypeValidatorExtension;
use Symfony\Component\Validator\ConstraintViolationList;

class TestedTypeTest extends TypeTestCase
{
protected function setUp()
{
parent::setUp();
$validator = $this->getMock('\Symfony\Component\Validator\ValidatorInterface');
$validator->method('validate')->will($this->returnValue(new ConstraintViolationList()));

$this->factory = Forms::createFormFactoryBuilder()
->addExtensions($this->getExtensions())
->addTypeExtension(
new FormTypeValidatorExtension(
$this->getMock('Symfony\Component\Validator\ValidatorInterface')
$validator
)
)
->addTypeGuesser(
Expand Down

0 comments on commit 73d44d1

Please sign in to comment.