Skip to content

Improve cookbook form unit testing #6203

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

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ parameter and uses it in the service definition.

.. code-block:: xml

<argument type="string">http://symfony.com/?foo=%%s&bar=%%d</argument>
<argument type="string">http://symfony.com/?foo=%%s&amp;bar=%%d</argument>

.. caution::

Expand Down
4 changes: 2 additions & 2 deletions components/config/definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Or the following XML configuration:

.. code-block:: xml

<driver>msyql</driver>
<driver>mysql</driver>
<driver>sqlite</driver>

The processed configuration is::
Expand Down Expand Up @@ -341,7 +341,7 @@ In order to maintain the array keys use the ``useAttributeAsKey()`` method::

The argument of this method (``name`` in the example above) defines the name of
the attribute added to each XML node to differentiate them. Now you can use the
same YAML configuration showed before or the following XML configuration:
same YAML configuration shown before or the following XML configuration:

.. code-block:: xml

Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ the parameter value in one place if needed.

.. code-block:: xml

<argument>http://symfony.com/?foo=%%s&bar=%%d</argument>
<argument>http://symfony.com/?foo=%%s&amp;bar=%%d</argument>

.. code-block:: php

Expand Down
1 change: 1 addition & 0 deletions components/event_dispatcher/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ subscribes to the ``kernel.response`` and ``store.order`` events::

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Acme\StoreBundle\Event\FilterOrderEvent;

class StoreSubscriber implements EventSubscriberInterface
{
Expand Down
6 changes: 4 additions & 2 deletions components/intl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ code::

.. code-block:: json

"require: {
"symfony/icu": "1.1.*"
{
"require": {
"symfony/icu": "1.1.*"
}
}

Set the version to
Expand Down
4 changes: 2 additions & 2 deletions contributing/code/core_team.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ Active Core Members
* **Abdellatif AitBoudad** (`aitboudad`_) can merge into the Translation_
component;

* **Jakub Zalas** (`jakzal`_) can merge into the DomCrawler_ component.
* **Jakub Zalas** (`jakzal`_) can merge into the DomCrawler_ component;

* **Christian Flothmann** (`xabbuh`_) can merge into the Yaml_ component.
* **Christian Flothmann** (`xabbuh`_) can merge into the Yaml_ component;

* **Javier Eguiluz** (`javiereguiluz`_) can merge into the WebProfilerBundle_
bundle.
Expand Down
2 changes: 1 addition & 1 deletion cookbook/assetic/apply_to_option.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ In this case you can specify that the ``coffee`` filter is applied to all
bin: /usr/bin/coffee
node: /usr/bin/node
node_paths: [/usr/lib/node_modules/]
apply_to: "\.coffee$"
apply_to: '\.coffee$'

.. code-block:: xml

Expand Down
2 changes: 0 additions & 2 deletions cookbook/configuration/override_dir_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,10 @@ The change in the ``composer.json`` will look like this:
.. code-block:: json

{
...
"config": {
"bin-dir": "bin",
"vendor-dir": "/some/dir/vendor"
},
...
}

Then, update the path to the ``autoload.php`` file in ``app/autoload.php``::
Expand Down
2 changes: 1 addition & 1 deletion cookbook/deployment/heroku.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ variables, you can issue a single command to prepare your app for a deployment:
Next up, it's finally time to deploy your application to Heroku. If you are
doing this for the very first time, you may see a message such as the following:

.. code-block:: bash
.. code-block:: text

The authenticity of host 'heroku.com (50.19.85.132)' can't be established.
RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad.
Expand Down
2 changes: 1 addition & 1 deletion cookbook/doctrine/mongodb_session_storage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Because MongoDB uses dynamic collection schemas, you do not need to do anything
session collection. However, you may want to add an index to improve garbage collection performance.
From the `MongoDB shell`_:

.. code-block:: sql
.. code-block:: javascript

use session_db
db.session.ensureIndex( { "expires_at": 1 }, { expireAfterSeconds: 0 } )
Expand Down
3 changes: 1 addition & 2 deletions cookbook/form/unit_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ The simplest ``TypeTestCase`` implementation looks like the following::
// src/AppBundle/Tests/Form/Type/TestedTypeTest.php
namespace AppBundle\Tests\Form\Type;

use AppBundle\Form\Type\TestedType;
use AppBundle\Model\TestObject;
use Symfony\Component\Form\Test\TypeTestCase;

Expand All @@ -52,7 +51,7 @@ The simplest ``TypeTestCase`` implementation looks like the following::
'test2' => 'test2',
);

$type = new TestedType();
$type = 'AppBundle\Form\Type\TestedType';
$form = $this->factory->create($type);

$object = TestObject::fromArray($formData);
Expand Down
1 change: 0 additions & 1 deletion cookbook/install/unstable_versions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ dependency as follows:

{
"require": {
// ...
"symfony/symfony" : "2.7.*@dev"
}
}
Expand Down
15 changes: 10 additions & 5 deletions cookbook/logging/monolog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,22 @@ option of your handler to ``rotating_file``:
.. code-block:: xml

<!-- app/config/config_dev.xml -->
<?xml version="1.0" charset="UTF-8" ?>
<container xmlns=''http://symfony.com/schema/dic/services"
xmlns:monolog="http://symfony.com/schema/dic/monolog">
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:monolog="http://symfony.com/schema/dic/monolog"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/monolog
http://symfony.com/schema/dic/monolog/monolog-1.0.xsd">

<monolog:config>
<!-- "max_files": max number of log files to keep
defaults to zero, which means infinite files -->
<monolog:handler name="main"
type="rotating_file"
path="%kernel.logs_dir%/%kernel.environment%.log"
level="debug"
<!-- max number of log files to keep
defaults to zero, which means infinite files -->
max_files="10"
/>
</monolog:config>
Expand Down
13 changes: 7 additions & 6 deletions cookbook/logging/monolog_email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,25 @@ it is broken down.
.. code-block:: xml

<!-- app/config/config_prod.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:monolog="http://symfony.com/schema/dic/monolog"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/monolog http://symfony.com/schema/dic/monolog/monolog-1.0.xsd">

<monolog:config>
<!--
To also log 400 level errors (but not 404's):
action-level="error"
And add this child inside this monolog:handler
<monolog:excluded-404>^/</monolog:excluded-404>
-->
<monolog:handler
name="mail"
type="fingers_crossed"
action-level="critical"
handler="buffered"
<!--
To also log 400 level errors (but not 404's):
action-level="error"
And add this child inside this monolog:handler
<monolog:excluded-404>^/</monolog:excluded-404>
-->
/>
<monolog:handler
name="buffered"
Expand Down
6 changes: 4 additions & 2 deletions cookbook/symfony1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ from specific directories without defining a dependency:

.. code-block:: json

"autoload": {
"psr-0": { "": "src/" }
{
"autoload": {
"psr-0": { "": "src/" }
}
}

This means that if a class is not found in the ``vendor`` directory, Composer
Expand Down
1 change: 0 additions & 1 deletion cookbook/testing/bootstrap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ with ``tests.bootstrap.php``:

<!-- ... -->
<phpunit
...
bootstrap = "tests.bootstrap.php"
>

Expand Down