8000 Merge branch '2.4' · symfony/symfony@77bfac7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 77bfac7

Browse files
committed
Merge branch '2.4'
* 2.4: [Form][2.3] Fixes empty file-inputs getting treated as extra field. changed some PHPUnit assertions to more specific ones fixed Kernel::stripComments() normalizing new-lines added a BC comment Update FileLoader to fix issue #10339 bumped Symfony version to 2.3.12 updated VERSION for 2.3.11 update CONTRIBUTORS for 2.3.11 updated CHANGELOG for 2.3.11 Throw exception when unable to normalize embedded object Fixed evaluation of short circuit operators Follow-up to #10312: Fixed minor performance related issues in Yaml\Inline. [2.4][HttpKernel] Fix issue #10209 When the profiler has `only_exception` option activated and a subrequest throw an exception, the parent profile cannot be found.
2 parents aed7eab + 09b0a40 commit 77bfac7

File tree

33 files changed

+302
-95
lines changed

33 files changed

+302
-95
lines changed

CHANGELOG-2.3.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ in 2.3 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.3.0...v2.3.1
99

10+
* 2.3.11 (2014-02-27)
11+
12+
* bug #10146 [WebProfilerBundle] fixed parsing Mongo DSN and added Test for it (malarzm)
13+
* bug #10299 [Finder] () is also a valid delimiter (WouterJ)
14+
* bug #10255 [FrameworkBundle] Fixed wrong redirect url if path contains some query parameters (pulzarraider)
15+
* bug #10285 Bypass sigchild detection if phpinfo is not available (Seldaek)
16+
* bug #10269 [Form] Revert "Fix "Array was modified outside object" in ResizeFormListener." (norzechowicz)
17+
1018
* 2.3.10 (2014-02-12)
1119

1220
* bug #10231 [Console] removed problematic regex (fabpot)

CONTRIBUTORS.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ Symfony2 is the result of the work of many people who made the code better
3333
- stealth35 ‏ (stealth35)
3434
- Alexander Mols (asm89)
3535
- Bulat Shakirzyanov (avalanche123)
36+
- Grégoire Pineau (lyrixx)
3637
- Francis Besset (francisbesset)
3738
- Miha Vrhovnik
3839
- Henrik Bjørnskov (henrikbjorn)
39-
- Grégoire Pineau (lyrixx)
4040
- Konstantin Kudryashov (everzet)
4141
- Bilal Amarni (bamarni)
4242
- Florin Patan (florinpatan)
4343
- Saša Stamenković (umpirsky)
4444
- Eric Clemmons (ericclemmons)
45+
- Wouter De Jong (wouterj)
4546
- Deni
4647
- Henrik Westphal (snc)
4748
- Dariusz Górecki (canni)
48-
- Wouter De Jong (wouterj)
49-
- Arnout Boks (aboks)
5049
- Andrej Hudec (pulzarraider)
50+
- Arnout Boks (aboks)
5151
- Lee McDermott
5252
- Brandon Turner
5353
- Daniel Holmes (dholmes)
@@ -162,6 +162,7 @@ Symfony2 is the result of the work of many people who made the code better
162162
- Wouter Van Hecke
163163
- Michael Holm (hollo)
164164
- Marc Weistroff (futurecat)
165+
- Pierre-Yves LEBECQ (pylebecq)
165166
- Roman Marintšenko (inori)
166167
- Florian Klein (docteurklein)
167168
- Manuel Kiessling (manuelkiessling)
@@ -175,7 +176,9 @@ Symfony2 is the result of the work of many people who made the code better
175176
- Uwe Jäger (uwej711)
176177
- Aurelijus Valeiša (aurelijus)
177178
- Gustavo Piltcher
179+
- Chekote
178180
- Stepan Tanasiychuk (stfalcon)
181+
- Tiago Ribeiro (fixe)
179182
- Bob den Otter (bopp)
180183
- Adrian Rudnik (kreischweide)
181184
- Francesc Rosàs (frosas)
@@ -184,6 +187,7 @@ Symfony2 is the result of the work of many people who made the code better
184187
- janschoenherr
185188
- Marco Pivetta (ocramius)
186189
- Ricard Clau (ricardclau)
190+
- Nicolas Grekas (nicolas-grekas)
187191
- Erin Millard
188192
- Matthew Lewinski (lewinski)
189193
- Manuel Reinhard (sprain)
@@ -197,7 +201,6 @@ Symfony2 is the result of the work of many people who made the code better
197201
- Felix Labrecque
198202
- Yaroslav Kiliba
199203
- Sébastien Lavoie (lavoiesl)
200-
- Pierre-Yves LEBECQ (pylebecq)
201204
- Terje Bråten
202205
- Kristen Gilden (kgilden)
203206
- hossein zolfi (ocean)
@@ -216,13 +219,11 @@ Symfony2 is the result of the work of many people who made the code better
216219
- Ismael Ambrosi (iambrosi)
217220
- Shein Alexey
218221
- Joe Lencioni
219-
- Chekote
220222
- Kai
221223
- Stefano Sala (stefano.sala)
222224
- Xavier HAUSHERR
223225
- Albert Jessurum (ajessu)
224226
- Laszlo Korte
225-
- Tiago Ribeiro (fixe)
226227
- Alessandro Desantis
227228
- hubert lecorche (hlecorche)
228229
- Eugene Leonovich (rybakit)
@@ -279,6 +280,8 @@ Symfony2 is the result of the work of many people who made the code better
279280
- alexpods
280281
- Erik Trapman (eriktrapman)
281282
- De Cock Xavier (xdecock)
283+
- Alex Pott
284+
- Norbert Orzechowicz (norzechowicz)
282285
- Matthijs van den Bos (matthijs)
283286
- Nils Adermann (naderman)
284287
- Gábor Fási
@@ -383,7 +386,6 @@ Symfony2 is the result of the work of many people who made the code better
383386
- Xavier Lacot (xavier)
384387
- Olivier Maisonneuve (olineuve)
385388
- Francis Turmel (fturmel)
386-
- Nicolas Grekas (nicolas-grekas)
387389
- cgonzalez
388390
- Jayson Xu (superjavason)
389391
- Jaik Dean (jaikdean)
@@ -458,6 +460,7 @@ Symfony2 is the result of the work of many people who made the code better
458460
- Chris Jones (leek)
459461
- xaav
460462
- Mahmoud Mostafa (mahmoud)
463+
- Gildas Quéméner (gquemener)
461464
- Ricky Su (ricky)
462465
- Radosław Benkel
463466
- ttomor
@@ -520,6 +523,7 @@ Symfony2 is the result of the work of many people who made the code better
520523
- Benoit Garret
521524
- DerManoMann
522525
- Roland Franssen (ro0)
526+
- Maciej Malarz
523527
- Rodrigo Díez Villamuera (rodrigodiez)
524528
- e-ivanov
525529
- Jochen Bayer (jocl)
@@ -654,6 +658,7 @@ Symfony2 is the result of the work of many people who made the code better
654658
- Ramon Kleiss (akathos)
655659
- Jakub Škvára (jskvara)
656660
- Nicolas Badey (nico-b)
661+
- Shane Preece (shane)
657662
- povilas
658663
- Alexander Obuhovich
659664
- Alessandro Tagliapietra (alex88)
@@ -672,6 +677,7 @@ Symfony2 is the result of the work of many people who made the code better
672677
- pborreli
673678
- Eric Caron
674679
- 2manypeople
680+
- Wing
675681
- Thomas Bibb
676682
- Josef Cech
677683
- Matthew Foster (mfoster)
@@ -687,6 +693,7 @@ Symfony2 is the result of the work of many people who made the code better
687693
- Andreas
688694
- Strate
689695
- Thomas Chmielowiec
696+
- Andrey Ryaguzov
690697
- Gunther Konig
691698
- František Bereň
692699
- Benjamin Grandfond (benjamin)
@@ -928,7 +935,6 @@ Symfony2 is the result of the work of many people who made the code better
928935
- Moritz Borgmann (mborgmann)
929936
- Matt Drollette (mdrollette)
930937
- Adam Monsen (meonkeys)
931-
- Norbert Orzechowicz (norzechowicz)
932938
- ollie harridge (ollietb)
933939
- Paweł Szczepanek (pauluz)
934940
- Petr Jaroš (petajaros)
@@ -949,6 +955,7 @@ Symfony2 is the result of the work of many people who made the code better
949955
- Eugene Babushkin (warl)
950956
- Xavier Amado (xamado)
951957
- Florent Cailhol
958+
- szymek
952959
- craigmarvelley
953960
- Stano Turza
954961
- simpson

src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ public function testTransform()
2929
$result = $this->transformer->transform(new PropelObjectCollection());
3030

3131
$this->assertTrue(is_array($result));
32-
$this->assertEquals(0, count($result));
32+
$this->assertCount(0, $result);
3333
}
3434

3535
public function testTransformWithNull()
3636
{
3737
$result = $this->transformer->transform(null);
3838

3939
$this->assertTrue(is_array($result));
40-
$this->assertEquals(0, count($result));
40+
$this->assertCount(0, $result);
4141
}
4242

4343
/**
@@ -56,7 +56,7 @@ public function testTransformWithData()
5656
$result = $this->transformer->transform($coll);
5757

5858
$this->assertTrue(is_array($result));
59-
$this->assertEquals(2, count($result));
59+
$this->assertCount(2, $result);
6060
$this->assertEquals('foo', $result[0]);
6161
$this->assertEquals('bar', $result[1]);
6262
}
@@ -66,15 +66,15 @@ public function testReverseTransformWithNull()
6666
$result = $this->transformer->reverseTransform(null);
6767

6868
$this->assertInstanceOf('\PropelObjectCollection', $result);
69-
$this->assertEquals(0, count($result->getData()));
69+
$this->assertCount(0, $result->getData());
7070
}
7171

7272
public function testReverseTransformWithEmptyString()
7373
{
7474
$result = $this->transformer->reverseTransform('');
7575

7676
$this->assertInstanceOf('\PropelObjectCollection', $result);
77-
$this->assertEquals(0, count($result->getData()));
77+
$this->assertCount(0, $result->getData());
7878
}
7979

8080
/**
@@ -95,7 +95,7 @@ public function testReverseTransformWithData()
9595
$this->assertInstanceOf('\PropelObjectCollection', $result);
9696

9797
$this->assertTrue(is_array($data));
98-
$this->assertEquals(2, count($data));
98+
$this->assertCount(2, $data);
9999
$this->assertEquals('foo', $data[0]);
100100
$this->assertEquals('bar', $data[1]);
101101
$this->assertsame($inputData, $data);

src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function ($template) { return $template->getLogicalName(); },
4646
$finder->findAllTemplates()
4747
);
4848

49-
$this->assertEquals(6, count($templates), '->findAllTemplates() find all templates in the bundles and global folders');
49+
$this->assertCount(6, $templates, '->findAllTemplates() find all templates in the bundles and global folders');
5050
$this->assertContains('BaseBundle::base.format.engine', $templates);
5151
$this->assertContains('BaseBundle::this.is.a.template.format.engine', $templates);
5252
$this->assertContains('BaseBundle:controller:base.format.engine', $templates);

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/TwigLoaderPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testMapperPassWithTwoTaggedLoaders()
7373

7474
$this->pass->process($this->builder);
7575
$calls = $this->chainLoader->getMethodCalls();
76-
$this->assertEquals(2, count($calls));
76+
$this->assertCount(2, $calls);
7777
$this->assertEquals('addLoader', $calls[0][0]);
7878
}
7979

src/Symfony/Component/Config/Loader/FileLoader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ public function import($resource, $type = null, $ignoreErrors = false, $sourceRe
6767
$loader = $this->resolve($resource, $type);
6868

6969
if ($loader instanceof FileLoader && null !== $this->currentDir) {
70-
$resource = $this->locator->locate($resource, $this->currentDir, false);
70+
// we fallback to the current locator to keep BC
71+
// as some some loaders do not call the parent __construct()
72+
// @deprecated should be removed in 3.0
73+
$locator = $loader->getLocator() ?: $this->locator;
74+
$resource = $locator->locate($resource, $this->currentDir, false);
7175
}
7276

7377
$resources = is_array($resource) ? $resource : array($resource);

src/Symfony/Component/Config/Tests/Definition/Builder/NodeBuilderTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testAddingANewNodeType()
4545
->setNodeClass('newtype', $class)
4646
->node('', 'newtype');
4747

48-
$this->assertEquals(get_class($node), $class);
48+
$this->assertInstanceOf($class, $node);
4949
}
5050

5151
public function testOverridingAnExistingNodeType()
@@ -57,7 +57,7 @@ public function testOverridingAnExistingNodeType()
5757
->setNodeClass('variable', $class)
5858
->node('', 'variable');
5959

60-
$this->assertEquals(get_class($node), $class);
60+
$this->assertInstanceOf($class, $node);
6161
}
6262

6363
public function testNodeTypesAreNotCaseSensitive()
@@ -67,25 +67,25 @@ public function testNodeTypesAreNotCaseSensitive()
6767
$node1 = $builder->node('', 'VaRiAbLe');
6868
$node2 = $builder->node('', 'variable');
6969

70-
$this->assertEquals(get_class($node1), get_class($node2));
70+
$this->assertInstanceOf(get_class($node1), $node2);
7171

7272
$builder->setNodeClass('CuStOm', __NAMESPACE__.'\\SomeNodeDefinition');
7373

7474
$node1 = $builder->node('', 'CUSTOM');
7575
$node2 = $builder->node('', 'custom');
7676

77-
$this->assertEquals(get_class($node1), get_class($node2));
77+
$this->assertInstanceOf(get_class($node1), $node2);
7878
}
7979

8080
public function testNumericNodeCreation()
8181
{
8282
$builder = new NodeBuilder();
8383

8484
$node = $builder->integerNode('foo')->min(3)->max(5);
85-
$this->assertEquals('Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition', get_class($node));
85+
$this->assertInstanceOf('Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition', $node);
8686

8787
$node = $builder->floatNode('bar')->min(3.0)->max(5.0);
88-
$this->assertEquals('Symfony\Component\Config\Definition\Builder\FloatNodeDefinition', get_class($node));
88+
$this->assertInstanceOf('Symfony\Component\Config\Definition\Builder\FloatNodeDefinition', $node);
8989
}
9090
}
9191

src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public function testUsingACustomNodeBuilder()
2828

2929
$nodeBuilder = $root->children();
3030

31-
$this->assertEquals(get_class($nodeBuilder), 'Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder');
31+
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder', $nodeBuilder);
3232

3333
$nodeBuilder = $nodeBuilder->arrayNode('deeper')->children();
3434

35-
$this->assertEquals(get_class($nodeBuilder), 'Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder');
35+
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder', $nodeBuilder);
3636
}
3737

3838
public function testOverrideABuiltInNodeType()
@@ -42,7 +42,7 @@ public function testOverrideABuiltInNodeType()
4242

4343
$definition = $root->children()->variableNode('variable');
4444

45-
$this->assertEquals(get_class($definition), 'Symfony\Component\Config\Tests\Definition\Builder\VariableNodeDefinition');
45+
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\VariableNodeDefinition', $definition);
4646
}
4747

4848
public function testAddANodeType()
@@ -52,7 +52,7 @@ public function testAddANodeType()
5252

5353
$definition = $root->children()->barNode('variable');
5454

55-
$this->assertEquals(get_class($definition), 'Symfony\Component\Config\Tests\Definition\Builder\BarNodeDefinition');
55+
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\BarNodeDefinition', $definition);
5656
}
5757

5858
public function testCreateABuiltInNodeTypeWithACustomNodeBuilder()
@@ -62,7 +62,7 @@ public function testCreateABuiltInNodeTypeWithACustomNodeBuilder()
6262

6363
$definition = $root->children()->booleanNode('boolean');
6464

65-
$this->assertEquals(get_class($definition), 'Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition');
65+
$this->assertInstanceOf('Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition', $definition);
6666
}
6767

6868
public function testPrototypedArrayNodeUseTheCustomNodeBuilder()

src/Symfony/Component/Config/Tests/Loader/FileLoaderTest.php

Lines changed: 18 additions & 4 deletions
< 52CD td data-grid-cell-id="diff-cd98d4386e50af1ae6bb4ae40bbd5763c8403788577fa6b5b24115d00bc8a0d5-31-33-0" data-selected="false" role="gridcell" style="background-color:var(--bgColor-accent-muted, var(--color-accent-subtle));flex-grow:1" tabindex="-1" valign="top" class="focusable-grid-cell diff-hunk-cell left-side" colSpan="4">
@@ -32,8 +34,13 @@ public function testImport()
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ class FileLoaderTest extends \PHPUnit_Framework_TestCase
2020
/**
2121
* @covers Symfony\Component\Config\Loader\FileLoader
2222
*/
23-
public function testImport()
23+
public function testImportWithFileLocatorDelegation()
2424
{
2525
$locatorMock = $this->getMock('Symfony\Component\Config\FileLocatorInterface');
26-
$locatorMock->expects($this->any())->method('locate')->will($this->onConsecutiveCalls(
26+
27+
$locatorMockForAdditionalLoader = $this->getMock('Symfony\Component\Config\FileLocatorInterface');
28+
$locatorMockForAdditionalLoader->expects($this->any())->method('locate')->will($this->onConsecutiveCalls(
2729
array('path/to/file1'), // Default
2830
array('path/to/file1', 'path/to/file2'), // First is imported
2931
array('path/to/file1', 'path/to/file2'), // Second is imported
3234
));
3335

3436
$fileLoader = new TestFileLoader($locatorMock);
37+
$fileLoader->setSupports(false);
3538
$fileLoader->setCurrentDir('.');
36-
$fileLoader->setResolver($loaderResolver = new LoaderResolver(array($fileLoader)));
39+
40+
$additionalLoader = new TestFileLoader($locatorMockForAdditionalLoader);
41+
$additionalLoader->setCurrentDir('.');
42+
43+
$fileLoader->setResolver($loaderResolver = new LoaderResolver(array($fileLoader, $additionalLoader)));
3744

3845
// Default case
3946
$this->assertSame('path/to/file1', $fileLoader->import('my_resource'));
@@ -66,14 +73,16 @@ public function testImport()
6673

6774
class TestFileLoader extends FileLoader
6875
{
76+
private $supports = true;
77+
6978
public function load($resource, $type = null)
7079
{
7180
return $resource;
7281
}
7382

7483
public function supports($resource, $type = null)
7584
{
76-
return true;
85+
return $this->supports;
7786
}
7887

7988
public function addLoading($resource)
@@ -90,4 +99,9 @@ public function clearLoading()
9099
{
91100
self::$loading = array();
92101
}
102+
103+
public function setSupports($supports)
104+
{
105+
$this->supports = $supports;
106+
}
93107
}

0 commit comments

Comments
 (0)
0