Skip to content

Commit 9b5b55d

Browse files
committed
Merge branch '2.8' into 3.0
* 2.8: #17676 - making the proxy instantiation compatible with ProxyManager 2.x by detecting proxy features Fix bug when using an private aliased factory service ChoiceFormField of type "select" could be "disabled" Update contributing docs [Console] Fix escaping of trailing backslashes Fix constraint validator alias being required [ci] clone with depth=1 to kill push-forced PRs Add check on If-Range header
2 parents 32aa36d + ff6fc6f commit 9b5b55d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use Symfony\Component\DependencyInjection\Definition;
1717
use Symfony\Component\DependencyInjection\Reference;
1818

19+
require_once __DIR__.'/../Fixtures/includes/foo.php';
20+
1921
class ReplaceAliasByActualDefinitionPassTest extends \PHPUnit_Framework_TestCase
2022
{
2123
public function testProcess()
@@ -46,6 +48,26 @@ public function testProcess()
4648
$this->assertSame('b_alias', (string) $resolvedFactory[0]);
4749
}
4850

51+
/**
52+
* @group legacy
53+
*/
54+
public function testPrivateAliasesInFactory()
55+
{
56+
$container = new ContainerBuilder();
57+
58+
$container->register('a', 'FooClass');
59+
$container->register('b', 'FooClass')
60+
->setFactoryService('a')
61+
->setFactoryMethod('getInstance');
62+
63+
$container->register('c', 'stdClass')->setPublic(false);
64+
$container->setAlias('c_alias', 'c');
65+
66+
$this->process($container);
67+
68+
$this->assertInstanceOf('FooClass', $container->get('b'));
69+
}
70+
4971
/**
5072
* @expectedException \InvalidArgumentException
5173
*/

0 commit comments

Comments
 (0)