Commit Graph

60 Commits

Author SHA1 Message Date
Fabien Potencier
a38e2c042b fixes PSR-0 issues in tests 2013-12-30 22:13:42 +01:00
Fabien Potencier
35b407f016 fixed CS for lambdas 2013-12-28 08:46:05 +01:00
Luis Cordova
bee06e9c58 fix 5528 let ArrayNode::normalizeValue respect order of value array provided 2013-12-17 08:49:53 +01:00
Luis Cordova
2e0bf0e2e1 fix #7243 allow 0 as arraynode name 2013-12-17 08:36:17 +01:00
Fabien Potencier
e0b751a2d8 Merge branch '2.2' into 2.3
* 2.2:
  fixed some typos
  fixed @expectedException class names

Conflicts:
	src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php
	src/Symfony/Component/Console/Tests/Command/CommandTest.php
	src/Symfony/Component/Locale/Tests/Stub/StubLocaleTest.php
	src/Symfony/Component/Locale/Tests/Stub/StubNumberFormatterTest.php
2013-11-25 15:49:41 +01:00
Fabien Potencier
8d69bb5886 fixed @expectedException class names 2013-11-25 09:44:14 +01:00
Christian Gärtner
f568e9919b Making tests pass on mac os x without this change tests would fail under mac os x at least in 10.8.2 2013-09-16 21:56:34 +02:00
Fabien Potencier
33e9571886 Merge branch '2.2' into 2.3
* 2.2:
  [FrameworkBundle][Security] Replaced void return type with null for consistency
  fixed CS
  NativeSessionStorage regenerate
  removed unneeded comment
  Use setTimeZone if this method exists.
  Fix FileResource test
  fixed wrong usage of unset()
  [HttpFoundation] Fixed the way path to directory is trimmed.
  [Console] Fixed argument parsing when a single dash is passed.

Conflicts:
	src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php
2013-09-13 14:20:37 +02:00
Adrien Brault
124cb17625 Fix FileResource test
I had the following test failing on OS X before:

There was 1 failure:

1) Symfony\Component\Config\Tests\Resource\FileResourceTest::testSerializeUnserialize
Failed asserting that two strings are identical.
2013-09-13 07:11:26 +02:00
Fabien Potencier
4de3a06f9b Merge branch '2.2' into 2.3
* 2.2:
  fix some file mode bug 755->644
2013-08-06 07:49:23 +02:00
bronze1man
addd560b0d fix some file mode bug 755->644 2013-08-06 10:31:28 +08:00
Fabien Potencier
c2c156835f Merge branch '2.2' into 2.3
* 2.2:
  Reverts JSON_NUMERIC_CHECK
  Just a Typo
  [Yaml] removed wrong comment removal inside a string block
  Fixing configuration validation error messages.
  [HtppKernel] fixed inline fragment renderer
  fixed inline fragment renderer
  ProgressHelper shows percentage complete.
  Comment fixed: RedrawFrequency is measured in steps.
  fix handling of a default 'template' as a string

Conflicts:
	src/Symfony/Component/Console/Helper/ProgressHelper.php
	src/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php
	src/Symfony/Component/HttpKernel/Tests/Fragment/HIncludeFragmentRendererTest.php
	src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php
2013-07-11 21:36:36 +02:00
Paul Seiffert
aaa40e5902 Fixing configuration validation error messages.
The min and max validation functions lead to incorrect error messages.
2013-07-10 16:03:01 +02:00
Jakub Zalas
804b1829ef [Config] Added tests for the FileResource and DirectoryResource. 2013-06-03 01:18:25 +01:00
Jakub Zalas
c5dda79778 [Config] Fixed @covers annotation which ignored some of the methods from the code coverage. 2013-06-03 01:05:06 +01:00
Jakub Zalas
bf769e0437 [Config] Added tests for the ConfigCache. 2013-06-03 00:52:04 +01:00
Fabien Potencier
498bfa33fa Merge branch '2.2'
* 2.2:
  fixed CS
  Fixed XML syntax.
  Fixed parsing of leading blank lines in folded scalars. Closes #7989.
  [Form] Fixed a method name.
  Added a test case for Loader::import().
  Fixed Loader import
  [Console] Added dedicated testcase for HelperSet class
  [Serializer] fixed CS (refs #7971)
  Fixed fatal error in normalize/denormalizeObject.
  Fixed 2 namespaces

Conflicts:
	src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php
	src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php
2013-05-10 20:12:13 +02:00
Fabien Potencier
70ea5a61c5 Merge branch '2.1' into 2.2
* 2.1:
  Fixed XML syntax.
  Fixed parsing of leading blank lines in folded scalars. Closes #7989.
  Added a test case for Loader::import().
  Fixed Loader import
  [Console] Added dedicated testcase for HelperSet class
2013-05-10 20:08:31 +02:00
Jakub Zalas
c93b9f72e5 Added a test case for Loader::import(). 2013-05-09 17:22:40 +02:00
Fabien Potencier
e6d7b126b1 added missing license blocks 2013-04-22 06:31:56 +02:00
Fabien Potencier
2b473cbb65 Merge branch '2.2'
* 2.2:
  added missing license blocks
  added missing license blocks
2013-04-22 06:30:07 +02:00
Fabien Potencier
f6875287b5 Merge branch '2.1' into 2.2
* 2.1:
  added missing license blocks
2013-04-22 06:28:56 +02:00
Fabien Potencier
76b67a1356 added missing license blocks 2013-04-22 06:28:40 +02:00
Fabien Potencier
1552a16420 Merge branch '2.2'
* 2.2:
  [Config] #7644 add tests for passing number looking attributes as strings
  [HttpFoundation][BrowserKit] fixed path when converting a cookie to a string
  [BrowserKit] removed dead code
  [HttpFoundation] fixed empty domain= in Cookie::__toString()
  fixed detection of secure cookies received over https
  [2.2] Pass ESI header to subrequests
  [Translation] removed an uneeded class property
  [Translation] removed unneeded getter/setter
  [Translator] added additional conversion for encodings other than utf-8
  fixed source messages to accept pluralized messages [Validator][translation][japanese] add messages for new validator
  fix a DI circular reference recognition bug
  [HttpFoundation] fixed the creation of sub-requests under some circumstances for IIS

Conflicts:
	src/Symfony/Component/HttpFoundation/Tests/CookieTest.php
2013-04-20 21:06:06 +02:00
Luis Cordova
d98118ac05 [Config] #7644 add tests for passing number looking attributes as strings 2013-04-20 20:42:10 +02:00
Fabien Potencier
5762b5e1d2 merged branch sescandell/parent_file_loading (PR #7399)
This PR was squashed before being merged into the master branch (closes #7399).

Discussion
----------

[Config] Add possibility to get "parent bundle resource file" in import file loading process

FileLoader doesn't throw FileLoaderImportCircularReferenceException anymore if another file matchs import request.

Currently if a Bundle is defined as child of another Bundle and if we try to import a Resource from parent Bundle into the same "overrided" Resource, we get a FileLoaderImportCircularReferenceException.

Now, FileLoader locates "available files" and try to import one of them (rule is "the first that is not currently loading").

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes?
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

b20386e [Config] Add possibility to get "parent bundle resource file" in import file loading process
2013-04-20 10:30:30 +02:00
Stéphane Escandell
b20386e61e [Config] Add possibility to get "parent bundle resource file" in import file loading process 2013-04-20 10:30:29 +02:00
Bernhard Schussek
d504732728 [Form] Added leading backslashes to @exceptionMessage doc blocks 2013-04-13 16:46:29 +02:00
Gábor Egyed
609636e95e [Config] tweaked dumper to indent multi-line info 2013-02-17 13:27:42 +01:00
TravisCarden
924c25642b Remove executable bit from all PHP files 2013-01-31 12:27:04 -06:00
Victor
fde7585967 [DIC] Better handling of enableable configurations 2013-01-28 18:21:49 +01:00
Bernhard Schussek
184c8e586f Fixed @expectedException definitions to reference absolute exception paths 2013-01-05 18:52:40 +01:00
Fabien Potencier
d97829e8a8 fixed CS 2012-12-20 08:41:17 +01:00
Fabien Potencier
e31d4f19d9 [Config] allowed the disabling of key normalization on some array nodes
This reverts #6086
2012-12-16 16:11:28 +01:00
Martin Hasoň
45aab0f1e0 [Config] Added parameter to check prefix in an element or an attribute name in XmlUtils::convertDomElementToArray 2012-12-14 15:34:03 +01:00
Martin Hasoň
fa8b0d82f1 [Config] Added a utils class for XML manipulations 2012-12-14 15:29:59 +01:00
Fabien Potencier
3c010db2cb Merge branch '2.1'
* 2.1:
  fixed CS
  fixed CS
  [Security] fixed path info encoding (closes #6040, closes #5695)
  [HttpFoundation] added some tests for the previous merge and removed dead code (closes #6037)
  Improved Cache-Control header when no-cache is sent
  removed unneeded comment
  Fix to allow null values in labels array
  fix date in changelog
  removed the Travis icon (as this is not stable enough -- many false positive, closes #6186)
  Revert "merged branch gajdaw/finder_splfileinfo_fpassthu (PR #4751)" (closes #6224)
  Fixed a typo
  Fixed: HeaderBag::parseCacheControl() not parsing quoted zero correctly
  [Form] Fix const inside an anonymous function
  [Config] Loader::import must return imported data
  [DoctrineBridge] Fixed caching in DoctrineType when "choices" or "preferred_choices" is passed
  [Form] Fixed the default value of "format" in DateType to DateType::DEFAULT_FORMAT if "widget" is not "single_text"
  [HttpFoundation] fixed a small regression

Conflicts:
	src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
2012-12-11 11:41:51 +01:00
Fabien Potencier
d2885adffe Merge branch '2.0' into 2.1
* 2.0:
  fixed CS
  removed the Travis icon (as this is not stable enough -- many false positive, closes #6186)
  [Config] Loader::import must return imported data
  [HttpFoundation] fixed a small regression

Conflicts:
	README.md
	src/Symfony/Bridge/Twig/Extension/FormExtension.php
	src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php
	src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_widget.html.php
	src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php
	src/Symfony/Component/Form/Form.php
	src/Symfony/Component/HttpFoundation/Request.php
	src/Symfony/Component/HttpFoundation/SessionStorage/PdoSessionStorage.php
	tests/Symfony/Tests/Bridge/Doctrine/Logger/DbalLoggerTest.php
2012-12-11 11:33:11 +01:00
Fabien Potencier
b27b749025 made usage of Composer autoloader for subtree-split unit tests 2012-11-09 14:10:06 +01:00
Fabien Potencier
0a3b012619 Merge branch '2.1'
* 2.1:
  Added Base64 encoding, decoding to MongoDBProfilerStorage
  Fix duplicated code and a field name
  refactor src/Symfony/Component/Translation/Loader/MoFileLoader.php
  fixed typo
  Update src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf
  fixed issue #5596 (Broken DOM with the profiler's toolbar set in position top)
  [Form] Fixed the testsuite for PHPUnit 3.6 as travis still uses it
  added dirs generated by build-data.php in locale component to .gitignore
  [Process] Fixed bug introduced by 7bafc69f38.
  [Process][Tests] Prove process fail (Add more test case)
  [Process][Tests] Prove process fail
  [HttpFoundation] Fixed the tests
  [DomCrawler] Added test for supported encodings by mbstring
  [Config] Fixed preserving keys in associative arrays
  [Console] Fixed return value for Command::run
  [Locale] Fixed tests
  [Console] Fix some input tests
  [Filesystem] Fixed tests on Windows
  [Config] Fixed tests on Windows
2012-09-28 19:52:09 +02:00
Fabien Potencier
f3fedac503 merged branch hason/config (PR #5589)
Commits
-------

c812b9d [Config] Fixed preserving keys in associative arrays

Discussion
----------

[2.1][Config] Fixed preserving keys in associative arrays

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
2012-09-27 14:29:01 +02:00
Martin Hasoň
c812b9dddc [Config] Fixed preserving keys in associative arrays 2012-09-24 23:36:53 +02:00
Martin Hasoň
65281fb56c [Config] Fixed tests on Windows 2012-09-21 14:13:08 +02:00
Fabien Potencier
46d90ce845 [Config] fixed CS 2012-09-20 07:46:50 +02:00
Fabien Potencier
b49f501ff2 merged branch jeanmonod/config-with-numeric-checks (PR #4714)
Commits
-------

71db836 Better config validation handling for numerical values:  * New node type Integer and Float  * New expressions: min() and max()

Discussion
----------

[2.2] [Config] Better handling for numerical values:

* New node type Integer and Float
* New expressions: ifLessThan(), ifGreaterThan(), ifInRange(), ifNotInRange()

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

by fabpot at 2012-07-03T08:50:22Z

As I said on PR #4713, adding more method clutters the API without any big benefits. I'm -1 on the PR.

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

by jeanmonod at 2012-07-03T08:54:36Z

I have been discuss it with @schmittjoh at the sflive, he was thinking it could be a good addition.
IMHO I think that if we want to encourage the usage of bundle configuration validation, we should make it as easy as possible to use...

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

by jeanmonod at 2012-07-03T08:59:42Z

A real life example:

    ->scalarNode('max_nb_items')
        ->validate()
            ->ifTrue(function($v){
                return !is_int($v) || (is_int($v) && $v<1);
            })
            ->thenInvalid('Must be a positive integer')
        ->end()
    ->end()

could be replaced by

    ->integerNode('max_nb_items')
        ->validate()
            ->ifLessThan(1);
            ->thenInvalid('Must be a positive integer')
        ->end()
    ->end()

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

by gnutix at 2012-07-03T09:03:06Z

I agree with @jeanmonod on this matter, the bundle configuration validation is already kind of a hassle to understand (and read), so it would be a good addition IMHO.

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

by fabpot at 2012-07-03T10:54:32Z

@schmittjoh What's your point of view?

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

by schmittjoh at 2012-07-03T14:10:37Z

The integer and float nodes are valuable additions imo which I wanted to add myself several times but simply did not have the time for.

As for the changes to the expression builder, I was not really passionate about them in Paris, but I did not mind either way. However, looking at this PR, I think they would be better implemented as methods on the definition builders, and validated directly by the nodes:

```php
$builder->integerNode('foo')->range(1, 4)->end();
$builder->integerNode('foo')->mustBeGreaterThan(5)->end();
```

This will also allow for these constraints to be introspected and added to generated documentation.

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

by fabpot at 2012-07-03T17:57:25Z

@jeanmonod Can you take into account the comments by @schmittjoh?

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

by jeanmonod at 2012-07-03T19:40:24Z

@fabpot Yes, I will try to move those 4 checks.

@schmittjoh If I put those tests into the ScalarNodeDefinition did you think it's ok? And did I have to make anything special for the documentation introspection?

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

by schmittjoh at 2012-07-03T19:56:00Z

You can take a look at the EnumNodeDefinition, and the EnumNode. They are
pretty simple, and should give you a good idea of how to implement it.

On Tue, Jul 3, 2012 at 9:46 PM, Jeanmonod David <
reply@reply.github.com
> wrote:

> @fabpot Yes, I will try to move those 4 checks.
>
> @schmittjoh If I put those tests into the ScalarNodeDefinition did you
> think it's ok? And did I have to make anything special for the
> documentation introspection?
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/4714#issuecomment-6744309
>

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

by jeanmonod at 2012-07-03T21:37:18Z

OK, I just refactor as requested. At the end, I didn't add the range() check. It can be easily done by chaining min and max, like this:

    $builder->integerNode('foo')->min(1)->max(4)->end();

@schmittjoh can you have a look?

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

by schmittjoh at 2012-07-03T21:48:17Z

Have you tested the builder API? Did you maybe forget to commit something?

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

by jeanmonod at 2012-07-03T21:52:45Z

Yes you are right, I forget the definition

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

by jeanmonod at 2012-07-03T22:15:45Z

OK, I realize now that I misunderstood the concept. I was thinking that a node was able to do self validation. But no, I will have to move my code to the node definition. So let's wait for a new commit...

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

by jeanmonod at 2012-07-06T06:13:55Z

@schmittjoh I just push the move to definition and the new abstract class Numeric. Can you review it?

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

by jeanmonod at 2012-07-10T05:12:59Z

@schmittjoh, @fabpot
I fix all the mention points, can you have a look at the final result?

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

by schmittjoh at 2012-07-10T06:38:20Z

There are still some excessive blank lines if you want to be perfect, but overall looks good now.

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

by jeanmonod at 2012-07-10T07:05:54Z

@schmittjoh I think the comments of @Baachi are not well placed in the diff. I execute php-cs-fix on all code, so level of perfectness is already good ;)

@fabpot Do you want some more complements before merging?

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

by fabpot at 2012-07-10T07:07:21Z

@jeanmonod I'm going to review the code once more and it will be merged for 2.2. Thanks for your work.

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

by fabpot at 2012-09-18T13:58:48Z

@jeanmonod Can you squash your commits before I merge? Thanks.

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

by jeanmonod at 2012-09-18T14:36:59Z

@fabpot Squash done

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

by fabpot at 2012-09-19T04:07:13Z

@jeanmonod One last thing: can you submit a PR on symfony/symfony-docs that update the documentation with the new possibilities?

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

by jeanmonod at 2012-09-20T05:32:01Z

@fabpot OK, Documentation PR done here: https://github.com/symfony/symfony-docs/pull/1732
2012-09-20 07:42:10 +02:00
Jeanmonod David
71db836e1f Better config validation handling for numerical values:
* New node type Integer and Float
 * New expressions: min() and max()
2012-09-18 16:22:25 +02:00
Pascal Borreli
6ac8e7308d Fixed typos 2012-07-28 22:02:29 +00:00
Pascal Borreli
4c726ea64c Fixed Phpdoc 2012-07-28 16:07:17 +00:00
Fabien Potencier
d100ffaf76 fixed CS 2012-07-09 14:54:20 +02:00
Jeanmonod David
9d730be385 Method rename and phpdoc fixes 2012-06-18 06:49:11 +02:00