Commit Graph

6232 Commits

Author SHA1 Message Date
Fabien Potencier
fe1f42f142 updated version back to dev 2011-07-23 17:20:56 +02:00
Fabien Potencier
39dd8aee47 updated VERSION to RC6 2011-07-23 17:15:58 +02:00
Fabien Potencier
169f1b57f1 [FrameworkBundle] added a note about why we cannot include Controller in the compiled classes 2011-07-23 16:40:25 +02:00
Fabien Potencier
d236fc3662 merged branch aboks/icu_version (PR #1776)
Commits
-------

86aeb04 [Form] Added skip for tests that require a higher version of the ICU library (needed by intl) than installed

Discussion
----------

[Form] Skip tests that are incompatible with the installed ICU (intl) library

Two tests for the `DateTimeToLocalizedStringTransformer` depend on a datetime-format that has only been added in version 3.8 of the ICU library (used by `intl`), see http://bugs.icu-project.org/trac/changeset/21815#file60. Some PHP-versions still ship with ICU 3.6 however.

This PR skips these tests when an incompatible version of the ICU library is detected. Unfortunately I had to copy-paste some code from `Symfony\Tests\Component\Locale\TestCase`, but I don't see any other way without creating a strange dependency between the tests for the Form and Locale components.

---------------------------------------------------------------------------

by Abhoryo at 2011/07/22 16:42:40 -0700

PHP 5.3.5 = ICU 3.6
PHP 5.3.6 = ICU 3.8
PHP 5.3.7rc4 = ICU 4.6

Since the RC3 of Symfony, config/check script recommends ICU 4.0+

---------------------------------------------------------------------------

by aboks at 2011/07/23 00:33:12 -0700

I noticed, but since it's not a hard requirement (and difficult for some people to install ICU 4.0+ at the moment) this PR would at least prevent false positives when people unable to upgrade run the test suite.
2011-07-23 16:15:26 +02:00
Fabien Potencier
9d3700427a merged branch aboks/console_test_decoration (PR #1774)
Commits
-------

04d0b6c [Console] Forced undecorated output in tests that rely on Application/Command-output being equal to a fixed value

Discussion
----------

[Console] Fixed tests that rely on undecorated Application/Command-output

Some tests compare the output of an `Application`/`Command` run to a fixed string. The output is decorated however (at least) when run on a Windows box with Ansicon installed.
This PR fixes these failing tests by forcing the `Application`/`Command`-output to be undecorated.
2011-07-23 16:13:19 +02:00
Fabien Potencier
64c89b1455 merged branch mazen/master (PR #1780)
Commits
-------

77802ef fixes #1779

Discussion
----------

fixes #1779
2011-07-23 16:05:47 +02:00
Marcel Beerta
77802efe4e fixes #1779 2011-07-23 07:02:50 -07:00
Fabien Potencier
05c8178349 changed VERSION to -DEV again 2011-07-22 22:48:46 +02:00
Fabien Potencier
9fe6c74a27 updated VERSION to 2.0.0-RC5 2011-07-22 22:25:36 +02:00
Fabien Potencier
edcdb4137f [HttpKernel] fixed possible double-classes in compiled classes 2011-07-22 22:17:31 +02:00
Arnout Boks
86aeb042a1 [Form] Added skip for tests that require a higher version of the ICU library (needed by intl) than installed 2011-07-22 22:16:48 +02:00
Fabien Potencier
18894762ee merged branch ericclemmons/fix-router-generator-empty-query-string (PR #1773)
Commits
-------

03c7cfe UrlGenerator no longer appends '?' if query string is empty

Discussion
----------

UrlGenerator no longer appends '?' if query string is empty

If you generate a URL using null parameters (`array('foo' => null, 'bar' => null')`), `http_build_query` returns an empty string, resulting in a trailing `?` at the end of the generated URL.

This fixes that so that, if there are `$extra` params & `http_build_query` is empty, the URL is no longer appended.

---------------------------------------------------------------------------

by fabpot at 2011/07/22 10:15:26 -0700

Can you add unit tests?

---------------------------------------------------------------------------

by ericclemmons at 2011/07/22 10:52:21 -0700

Yes sir, will do.

-Eric Clemmons
 Sent from my iPad Nano

On Jul 22, 2011, at 12:15 PM, fabpot<reply@reply.github.com> wrote:

> Can you add unit tests?
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1773#issuecomment-1633515

---------------------------------------------------------------------------

by ericclemmons at 2011/07/22 11:55:30 -0700

**Added passing test.**

Currently `master` fails test:

```
1) Symfony\Tests\Component\Routing\Generator\UrlGeneratorTest::testUrlWithNullExtraParameters
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-http://localhost/app.php/testing
+http://localhost/app.php/testing?

//tests/Symfony/Tests/Component/Routing/Generator/UrlGeneratorTest.php:114
```
2011-07-22 22:00:27 +02:00
Arnout Boks
04d0b6c821 [Console] Forced undecorated output in tests that rely on Application/Command-output being equal to a fixed value 2011-07-22 21:06:35 +02:00
Eric Clemmons
03c7cfed5e UrlGenerator no longer appends '?' if query string is empty 2011-07-22 11:53:54 -07:00
Fabien Potencier
eb7c86b7a8 [HttpKernel] removed the need to keep the compiled classes in the container 2011-07-22 19:10:59 +02:00
Fabien Potencier
e16c226a5c [HttpKernel] changed the way compiled classes are managed to be sure that they are included before the Kernel is booted
If not, as classes can be loaded during the boot, there is no way to be sure that
a class will not be already loaded by a third party bundle.

If the Kernel is already booted, we don't included the compiled classes.
2011-07-22 18:52:34 +02:00
Fabien Potencier
e91ca34ead updated UPDATE file 2011-07-22 17:45:02 +02:00
Fabien Potencier
e9d82506f7 merged branch marcw/revert-1758 (PR #1769)
Commits
-------

d43d621 [Form] Reverted PR #1758.

Discussion
----------

[Form] Reverted PR #1758.

Revert "[Form] CollectionType now checks for data_class parameter instead of only class."

This reverts commit 2e024f87a3.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php

Revert "[Form] Added ObjectFactoryListener. Fixes #1746."

This reverts commit 0327beb0b9.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php
2011-07-22 17:43:42 +02:00
Fabien Potencier
1cec45c421 [BrowserKit] fixed test insulation on Mac 2011-07-22 17:40:14 +02:00
marc.weistroff
d43d621829 [Form] Reverted PR #1758.
Revert "[Form] CollectionType now checks for data_class parameter instead of only class."

This reverts commit 2e024f87a3.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php

Revert "[Form] Added ObjectFactoryListener. Fixes #1746."

This reverts commit 0327beb0b9.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php
2011-07-22 16:42:50 +02:00
Fabien Potencier
20a704431e [SecurityBundle] fixed typo in tests 2011-07-22 14:50:38 +02:00
Fabien Potencier
aab0bf7e2c merged branch schmittjoh/httpUtilFixes (PR #1739)
Commits
-------

eae6a77 fixed wrong case
d0a175b fixes #1659
f300ede fixes several bugs
a4f05ac added some tests

Discussion
----------

Http util fixes

Fixes several bugs in the http utils.

Please don't add anymore features without sufficient tests. Especially for the Security\Http namespace, regressions are very likely otherwise.

---------------------------------------------------------------------------

by fabpot at 2011/07/19 22:37:26 -0700

Tests do not pass for me:

    There were 2 errors:

    1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #0 ('en')
    InvalidArgumentException: The current node list is empty.

    .../src/Symfony/Component/DomCrawler/Crawler.php:604
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16

    2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #1 ('de')
    InvalidArgumentException: The current node list is empty.

    .../src/Symfony/Component/DomCrawler/Crawler.php:604
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16

    --

    There were 4 failures:

    1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #0 ('en')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -http://localhost/en/login
    +http://localhost/login

    .../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38

    2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #1 ('de')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -http://localhost/de/login
    +http://localhost/login

    .../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38

    3) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #0 ('en')
    HTTP/1.0 302 Found
    Cache-Control:  no-cache
    Content-Length: 299
    Content-Type:   text/html; charset=UTF-8
    Date:           Wed, 20 Jul 2011 05:36:27 GMT
    Location:       http://localhost/login
    Set-Cookie: PHPSESSID=11c9c6a7e7620e13bddef223a5ba46d9; path=/; domain=

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>
    Failed asserting that <integer:0> matches expected <integer:1>.

    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50

    4) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #1 ('de')
    HTTP/1.0 302 Found
    Cache-Control:  no-cache
    Content-Length: 299
    Content-Type:   text/html; charset=UTF-8
    Date:           Wed, 20 Jul 2011 05:36:28 GMT
    Location:       http://localhost/login
    Set-Cookie: PHPSESSID=2bbe63786a088471ade3717917f4ba4f; path=/; domain=

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>
    Failed asserting that <integer:0> matches expected <integer:1>.

    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50

---------------------------------------------------------------------------

by schmittjoh at 2011/07/19 23:47:29 -0700

I fixed a wrong case, but I couldn't reproduce the other errors (tested on Ubuntu).

My guess is that the temporary directory on your machine couldn't be deleted for some reason, and the test runs with the configuration of some of the previous tests.

---------------------------------------------------------------------------

by fabpot at 2011/07/20 00:28:41 -0700

That does not make any difference for me. For instance, in `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request to `'/'.$locale.'/login'` returns the following Response:

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>

---------------------------------------------------------------------------

by schmittjoh at 2011/07/20 00:31:34 -0700

That's weird, did you make sure that the temporary directory does not exist?

``rm -Rf /tmp/StandardFormLogin/``

On Wed, Jul 20, 2011 at 9:28 AM, fabpot <
reply@reply.github.com>wrote:

> That does not make any difference for me. For instance, in
> `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request
> to `'/'.$locale.'/login'` returns the following Response:
>
>    <html>
>        <head>
>            <meta http-equiv="Content-Type" content="text/html;
> charset=utf-8" />
>            <meta http-equiv="refresh" content="1;url=
> http://localhost/login" />
>        </head>
>        <body>
>            Redirecting to <a href="http://localhost/login">
> http://localhost/login</a>.
>        </body>
>    </html>
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1739#issuecomment-1613504
>

---------------------------------------------------------------------------

by fabpot at 2011/07/20 00:33:40 -0700

Yes, I've just checked and the directory does not exist.

---------------------------------------------------------------------------

by schmittjoh at 2011/07/20 00:39:55 -0700

Sorry, I can't reproduce it on Ubuntu and unless someone wants to sponsor me a Mac, there is not much I can do.
2011-07-22 14:45:54 +02:00
Fabien Potencier
cc07af2449 [ClassLoader] replaced MapFileClassLoader by MapClassLoader 2011-07-22 14:44:33 +02:00
Fabien Potencier
5d9bd6da4f [TwigBundle] fixed XSS in the exception template 2011-07-22 13:42:59 +02:00
Fabien Potencier
6419456de4 [Security] change a comparison to use a strict comparison 2011-07-22 13:37:59 +02:00
Fabien Potencier
9bf6216a85 added missing ' escaping 2011-07-22 13:37:23 +02:00
Fabien Potencier
c6115cee7f [BrowserKit] changed Cookie::fromString() to not take the secure setting into account if the URL is not present or is not HTTPS 2011-07-22 13:29:57 +02:00
Fabien Potencier
f29da2fcc8 merged branch marcw/form-prototype-attribute (PR #1724)
Commits
-------

257f86c [Form] Collection's prototype is not not a child anymore.
2b4cc9b [Form] Changed collection prototype rendering.

Discussion
----------

[Form] Changed collection prototype rendering

Based on PR #1500. It is now rendered inside an attribute of collection
tag.

The data-attribute can be retrieved using this piece of jQuery code. You aways will need to adapt it. I think this will be also doable with plain JS.

```javascript
<script type="text/javascript">
        jQuery('p.add-child').click(function() {
            var prototype = $('form #id').attr('data-prototype');
            prototype = prototype.replace(/\$\$name\$\$/g, 'levelxx');
            $('#id').append(prototype);
        });
</script>
```

Closes #1497

---------------------------------------------------------------------------

by beberlei at 2011/07/18 06:40:40 -0700

form div[data-prototype]? What about forms with two collections?

---------------------------------------------------------------------------

by marcw at 2011/07/18 07:25:51 -0700

My bad, the javascript snippet is not crystal clear. Actually, you'll have to specify the div's id to retrieve the right `data-prototype` attribute.
The good way of doing this is by specifying the div's id in the selector (like in the 2nd part of the js example), like this :

    var prototype = $('form #level1_level2_level3_level3').attr('data-prototype');

---------------------------------------------------------------------------

by tystr at 2011/07/18 12:32:39 -0700

+1

---------------------------------------------------------------------------

by marcw at 2011/07/22 01:46:08 -0700

thanx @vicb ! :)
2011-07-22 11:04:08 +02:00
marc.weistroff
257f86cb20 [Form] Collection's prototype is not not a child anymore. 2011-07-22 11:03:06 +02:00
marc.weistroff
2b4cc9bd06 [Form] Changed collection prototype rendering.
Based on PR 1500. It is now rendered inside an attribute of collection
tag.
2011-07-22 11:01:55 +02:00
Fabien Potencier
49dda530e0 merged branch marcw/issue-1746 (PR #1758)
Commits
-------

2e024f8 [Form] CollectionType now checks for data_class parameter instead of only class.
0327beb [Form] Added ObjectFactoryListener. Fixes #1746.

Discussion
----------

[Form] Added ObjectFactoryListener. Fixes #1746.

---------------------------------------------------------------------------

by marcw at 2011/07/21 09:32:17 -0700

This patch also fixes a validation issue because it was impossible for the validator to validate an array.

---------------------------------------------------------------------------

by stof at 2011/07/21 09:47:46 -0700

yeah, using the data_class of the prototype would be great
2011-07-22 10:11:44 +02:00
Fabien Potencier
d96c152c4c [HttpKernel] fixed error message in HttpKernel 2011-07-22 09:55:31 +02:00
Fabien Potencier
84abbbd6df [HttpKernel] enhanced the ExceptionHandler so that it can be used in prod environment too (mainly useful for Silex) 2011-07-22 09:38:05 +02:00
Fabien Potencier
3f3f8e8002 [ClassLoader] removed obsolete code 2011-07-21 23:27:21 +02:00
Fabien Potencier
6b0a9ff784 [HttpKernel] changed the compiled class cache to non-adaptative (as it is now loaded very early) 2011-07-21 22:33:29 +02:00
Fabien Potencier
e776d5dbce [FrameworkBundle] tweaked compiled class cache 2011-07-21 22:32:50 +02:00
Fabien Potencier
cede13e8cc [FrameworkBundle] moved the SessionListener to the session.xml configuration file 2011-07-21 22:32:21 +02:00
Fabien Potencier
ccda267c36 [FrameworkBundle] fixed wrong order in classes to compile 2011-07-21 21:44:10 +02:00
Fabien Potencier
7062cc2db5 [HttpKernel] fixed compiled classes 2011-07-21 21:32:57 +02:00
Fabien Potencier
e5eab90169 Revert "merged branch trompette/patch-1 (PR #1761)"
This reverts commit 8e3b9c334d, reversing
changes made to 61f02902fe.
2011-07-21 21:32:57 +02:00
Fabien Potencier
b06a5dfcf3 merged branch andreia/master (PR #1760)
Commits
-------

350f207 Update the CSRF message

Discussion
----------

Update the CSRF message

Update the CSRF message
2011-07-21 20:57:10 +02:00
Fabien Potencier
8e3b9c334d merged branch trompette/patch-1 (PR #1761)
Commits
-------

e2b249d fixed typo

Discussion
----------

fixed typo
2011-07-21 20:56:57 +02:00
Fabien Potencier
61f02902fe added missing information in UPDATE file 2011-07-21 20:44:42 +02:00
marc.weistroff
2e024f87a3 [Form] CollectionType now checks for data_class parameter instead of only class. 2011-07-21 19:50:40 +02:00
Fabien Potencier
db9a37530e udpated UPDATE file 2011-07-21 19:28:44 +02:00
Fabien Potencier
3749ad43f4 moved the Exception listener from FrameworkBundle to TwigBundle as it relies on Twig being enabled
This commit also fixes exception pages when Twig is not enabled as a templating engine.
Instead of just displaying the raw Twig template as before, we now fallback to the default
exception handler introduced some time ago.
2011-07-21 19:24:04 +02:00
Benoît Merlet
e2b249da08 fixed typo 2011-07-21 09:35:16 -07:00
Andreia Bohner
350f2076ba Update the CSRF message 2011-07-21 12:47:42 -03:00
marc.weistroff
0327beb0b9 [Form] Added ObjectFactoryListener. Fixes #1746. 2011-07-21 15:02:52 +02:00
Fabien Potencier
08730b604b merged branch andreia/master (PR #1754)
Commits
-------

cb37572 Update the Brazilian Portuguese validator translations and fix typo
e0e4778 Revert "Update the Brazilian Portuguese validator translations and fix typo"
63f0707 Update the Brazilian Portuguese validator translations and fix typo

Discussion
----------

Update pt_BR translations

Update the Brazilian Portuguese validator translations and fix typo
2011-07-21 04:43:13 +02:00