Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 61475b5

Browse filesBrowse files
Merge branch '3.2'
* 3.2: fix getMock usage fix merge [DependencyInjection] Fixed variadic method parameter in autowired classes update German translation [Validator] Improved error message for missing upload_tmp_dir
2 parents 71b8a66 + ba41e70 commit 61475b5
Copy full SHA for 61475b5

File tree

10 files changed

+52
-12
lines changed
Filter options

10 files changed

+52
-12
lines changed

‎src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/ExtensionPassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Compiler/ExtensionPassTest.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,20 @@ public function testProcessDoesNotDropExistingFileLoaderMethodCalls()
2121
{
2222
$container = new ContainerBuilder();
2323
$container->setParameter('kernel.debug', false);
24+
$container->setParameter('kernel.root_dir', __DIR__);
2425

2526
$container->register('twig.app_variable', '\Symfony\Bridge\Twig\AppVariable');
2627
$container->register('templating', '\Symfony\Bundle\TwigBundle\TwigEngine');
28+
$container->register('twig.extension.yaml');
29+
$container->register('twig.extension.debug.stopwatch');
30+
$container->register('twig.extension.expression');
2731

2832
$nativeTwigLoader = new Definition('\Twig_Loader_Filesystem');
2933
$nativeTwigLoader->addMethodCall('addPath', array());
3034
$container->setDefinition('twig.loader.native_filesystem', $nativeTwigLoader);
3135

3236
$filesystemLoader = new Definition('\Symfony\Bundle\TwigBundle\Loader\FilesystemLoader');
37+
$filesystemLoader->setArguments(array(null, null, null));
3338
$filesystemLoader->addMethodCall('addPath', array());
3439
$container->setDefinition('twig.loader.filesystem', $filesystemLoader);
3540

‎src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ function () {},
255255

256256
// assertEquals() does not like NAN values.
257257
$this->assertEquals($array[$i][0], 'float');
258-
$this->assertNan($array[$i++][1]);
258+
$this->assertTrue(is_nan($array[$i++][1]));
259259
}
260260

261261
public function testRecursionInArguments()

‎src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,11 @@ private static function getResourceMetadataForMethod(\ReflectionMethod $method)
428428
$class = false;
429429
}
430430

431+
$isVariadic = method_exists($parameter, 'isVariadic') && $parameter->isVariadic();
431432
$methodArgumentsMetadata[] = array(
432433
'class' => $class,
433434
'isOptional' => $parameter->isOptional(),
434-
'defaultValue' => $parameter->isOptional() ? $parameter->getDefaultValue() : null,
435+
'defaultValue' => ($parameter->isOptional() && !$isVariadic) ? $parameter->getDefaultValue() : null,
435436
);
436437
}
437438

‎src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\DependencyInjection\Compiler\AutowirePass;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Reference;
17+
use Symfony\Component\DependencyInjection\Tests\Fixtures\includes\FooVariadic;
1718

1819
/**
1920
* @author Kévin Dunglas <dunglas@gmail.com>
@@ -35,6 +36,23 @@ public function testProcess()
3536
$this->assertEquals('foo', (string) $container->getDefinition('bar')->getArgument(0));
3637
}
3738

39+
/**
40+
* @requires PHP 5.6
41+
*/
42+
public function testProcessVariadic()
43+
{
44+
$container = new ContainerBuilder();
45+
$container->register('foo', Foo::class);
46+
$definition = $container->register('fooVariadic', FooVariadic::class);
47+
$definition->setAutowired(true);
48+
49+
$pass = new AutowirePass();
50+
$pass->process($container);
51+
52+
$this->assertCount(1, $container->getDefinition('fooVariadic')->getArguments());
53+
$this->assertEquals('foo', (string) $container->getDefinition('fooVariadic')->getArgument(0));
54+
}
55+
3856
public function testProcessAutowireParent()
3957
{
4058
$container = new ContainerBuilder();
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\includes;
4+
5+
use Symfony\Component\DependencyInjection\Tests\Compiler\Foo;
6+
7+
class FooVariadic
8+
{
9+
public function __construct(Foo $foo)
10+
{
11+
}
12+
13+
public function bar(...$arguments)
14+
{
15+
}
16+
}

‎src/Symfony/Component/Security/Core/Tests/User/LdapUserProviderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Tests/User/LdapUserProviderTest.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,14 @@ public function testLoadUserByUsernameFailsIfMoreThanOneLdapPasswordsInEntry()
156156
*/
157157
public function testLoadUserByUsernameFailsIfEntryHasNoUidKeyAttribute()
158158
{
159-
$result = $this->getMock(CollectionInterface::class);
160-
$query = $this->getMock(QueryInterface::class);
159+
$result = $this->getMockBuilder(CollectionInterface::class)->getMock();
160+
$query = $this->getMockBuilder(QueryInterface::class)->getMock();
161161
$query
162162
->expects($this->once())
163163
->method('execute')
164164
->will($this->returnValue($result))
165165
;
166-
$ldap = $this->getMock(LdapInterface::class);
166+
$ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
167167
$result
168168
->expects($this->once())
169169
->method('offsetGet')
@@ -321,14 +321,14 @@ public function testLoadUserByUsernameIsSuccessfulWithoutPasswordAttributeAndWro
321321

322322
public function testLoadUserByUsernameIsSuccessfulWithPasswordAttribute()
323323
{
324-
$result = $this->getMock(CollectionInterface::class);
325-
$query = $this->getMock(QueryInterface::class);
324+
$result = $this->getMockBuilder(CollectionInterface::class)->getMock();
325+
$query = $this->getMockBuilder(QueryInterface::class)->getMock();
326326
$query
327327
->expects($this->once())
328328
->method('execute')
329329
->will($this->returnValue($result))
330330
;
331-
$ldap = $this->getMock(LdapInterface::class);
331+
$ldap = $this->getMockBuilder(LdapInterface::class)->getMock();
332332
$result
333333
->expects($this->once())
334334
->method('offsetGet')

‎src/Symfony/Component/Validator/Resources/translations/validators.de.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.de.xlf
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
</trans-unit>
193193
<trans-unit id="51">
194194
<source>No temporary folder was configured in php.ini.</source>
195-
<target>Es wurde kein temporärer Ordner in der php.ini konfiguriert.</target>
195+
<target>Es wurde kein temporärer Ordner in der php.ini konfiguriert oder der temporäre Ordner existiert nicht.</target>
196196
</trans-unit>
197197
<trans-unit id="52">
198198
<source>Cannot write temporary file to disk.</source>

‎src/Symfony/Component/Validator/Resources/translations/validators.en.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.en.xlf
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
</trans-unit>
193193
<trans-unit id="51">
194194
<source>No temporary folder was configured in php.ini.</source>
195-
<target>No temporary folder was configured in php.ini.</target>
195+
<target>No temporary folder was configured in php.ini, or the configured folder does not exist.</target>
196196
</trans-unit>
197197
<trans-unit id="52">
198198
<source>Cannot write temporary file to disk.</source>

‎src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
</trans-unit>
193193
<trans-unit id="51">
194194
<source>No temporary folder was configured in php.ini.</source>
195-
<target>Er is geen tijdelijke map geconfigureerd in php.ini.</target>
195+
<target>Er is geen tijdelijke map geconfigureerd in php.ini, of de gespecificeerde map bestaat niet.</target>
196196
</trans-unit>
197197
<trans-unit id="52">
198198
<source>Cannot write temporary file to disk.</source>

‎src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
</trans-unit>
193193
<trans-unit id="51">
194194
<source>No temporary folder was configured in php.ini.</source>
195-
<target>Nie skonfigurowano folderu tymczasowego w php.ini.</target>
195+
<target>Nie skonfigurowano folderu tymczasowego w php.ini, lub skonfigurowany folder nie istnieje.</target>
196196
</trans-unit>
197197
<trans-unit id="52">
198198
<source>Cannot write temporary file to disk.</source>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.