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 e55f6e6

Browse filesBrowse files
committed
fix tests
1 parent 3e0b235 commit e55f6e6
Copy full SHA for e55f6e6

File tree

Expand file treeCollapse file tree

4 files changed

+17
-32
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+17
-32
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
2222
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2323
use Symfony\Component\DependencyInjection\Reference;
24+
use Symfony\Component\DependencyInjection\Tests\Fixtures\CaseSensitiveClass;
2425
use Symfony\Component\DependencyInjection\Tests\Fixtures\includes\FooVariadic;
2526
use Symfony\Component\DependencyInjection\TypedReference;
26-
use Symfony\Component\HttpKernel\HttpKernelInterface;
2727

2828
require_once __DIR__.'/../Fixtures/includes/autowiring_classes.php';
2929

@@ -606,13 +606,17 @@ public function testSetterInjection()
606606
);
607607
}
608608

609+
/**
610+
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
611+
* @exceptedExceptionMessage Invalid service "Symfony\Component\DependencyInjection\Tests\Fixtures\NamedArgumentsDummy": method "setLogger()" does not exist.
612+
*/
609613
public function testWithNonExistingSetterAndAutowiring()
610614
{
611615
$container = new ContainerBuilder();
612616

613-
$definition = $container->register(HttpKernelInterface::class, HttpKernelInterface::class)->setAutowired(true);
617+
$definition = $container->register(CaseSensitiveClass::class, CaseSensitiveClass::class)->setAutowired(true);
614618
$definition->addMethodCall('setLogger');
615-
$this->expectException(RuntimeException::class);
619+
616620
(new ResolveClassPass())->process($container);
617621
(new AutowireRequiredMethodsPass())->process($container);
618622
(new AutowirePass())->process($container);

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveBindingsPassTest.php
+5-28Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@
1717
use Symfony\Component\DependencyInjection\Compiler\ResolveBindingsPass;
1818
use Symfony\Component\DependencyInjection\ContainerBuilder;
1919
use Symfony\Component\DependencyInjection\Definition;
20-
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
2120
use Symfony\Component\DependencyInjection\Reference;
2221
use Symfony\Component\DependencyInjection\Tests\Fixtures\CaseSensitiveClass;
2322
use Symfony\Component\DependencyInjection\Tests\Fixtures\NamedArgumentsDummy;
2423
use Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists;
2524
use Symfony\Component\DependencyInjection\TypedReference;
26-
use Symfony\Component\HttpKernel\HttpKernelInterface;
2725

2826
require_once __DIR__.'/../Fixtures/includes/autowiring_classes.php';
2927

@@ -115,6 +113,10 @@ public function testScalarSetter()
115113
$this->assertEquals([['setDefaultLocale', ['fr']]], $definition->getMethodCalls());
116114
}
117115

116+
/**
117+
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
118+
* @exceptedExceptionMessage Invalid service "Symfony\Component\DependencyInjection\Tests\Fixtures\NamedArgumentsDummy": method "setLogger()" does not exist.
119+
*/
118120
public function testWithNonExistingSetterAndBinding()
119121
{
120122
$container = new ContainerBuilder();
@@ -123,36 +125,11 @@ public function testWithNonExistingSetterAndBinding()
123125
'$c' => (new Definition('logger'))->setFactory('logger'),
124126
];
125127

126-
$definition = $container->register(HttpKernelInterface::class, HttpKernelInterface::class);
127-
$definition->addMethodCall('setLogger');
128-
$definition->setBindings($bindings);
129-
$this->expectException(RuntimeException::class);
130-
131-
$pass = new ResolveBindingsPass();
132-
$pass->process($container);
133-
}
134-
135-
public function testTupleBinding()
136-
{
137-
$container = new ContainerBuilder();
138-
139-
$bindings = [
140-
'$c' => new BoundArgument(new Reference('bar')),
141-
CaseSensitiveClass::class.'$c' => new BoundArgument(new Reference('foo')),
142-
];
143-
144128
$definition = $container->register(NamedArgumentsDummy::class, NamedArgumentsDummy::class);
145-
$definition->addMethodCall('setSensitiveClass');
146-
$definition->addMethodCall('setAnotherC');
129+
$definition->addMethodCall('setLogger');
147130
$definition->setBindings($bindings);
148131

149132
$pass = new ResolveBindingsPass();
150133
$pass->process($container);
151-
152-
$expected = [
153-
['setSensitiveClass', [new Reference('foo')]],
154-
['setAnotherC', [new Reference('bar')]],
155-
];
156-
$this->assertEquals($expected, $definition->getMethodCalls());
157134
}
158135
}

‎src/Symfony/Component/Translation/DataCollectorTranslator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/DataCollectorTranslator.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ public function getCatalogue($locale = null)
9393
*/
9494
public function warmUp($cacheDir)
9595
{
96-
return $this->translator->warmUp($cacheDir);
96+
if ($this->translator instanceof WarmableInterface) {
97+
$this->translator->warmUp($cacheDir);
98+
}
9799
}
98100

99101
/**

‎src/Symfony/Component/Translation/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/composer.json
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"require-dev": {
2323
"symfony/config": "~2.8|~3.0|~4.0",
2424
"symfony/dependency-injection": "~3.4|~4.0",
25+
"symfony/http-kernel": "~3.4|~4.0",
2526
"symfony/intl": "^2.8.18|^3.2.5|~4.0",
27+
"symfony/var-dumper": "~3.4|~4.0",
2628
"symfony/yaml": "~3.4|~4.0",
2729
"symfony/finder": "~2.8|~3.0|~4.0",
2830
"psr/log": "~1.0"

0 commit comments

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