Skip to content

Commit f0744f9

Browse files
[DI] Fix private-by-default BC layer
1 parent d511cf4 commit f0744f9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Tests/DependencyInjection/FormPassTest.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public function testAddTaggedTypes()
5151
$container = $this->createContainerBuilder();
5252

5353
$container->setDefinition('form.extension', $this->createExtensionDefinition());
54-
$container->register('my.type1', __CLASS__.'_Type1')->addTag('form.type');
55-
$container->register('my.type2', __CLASS__.'_Type2')->addTag('form.type');
54+
$container->register('my.type1', __CLASS__.'_Type1')->addTag('form.type')->setPublic(true);
55+
$container->register('my.type2', __CLASS__.'_Type2')->addTag('form.type')->setPublic(true);
5656

5757
$container->compile();
5858

@@ -73,8 +73,8 @@ public function testAddTaggedTypesToDebugCommand()
7373

7474
$container->setDefinition('form.extension', $this->createExtensionDefinition());
7575
$container->setDefinition(DebugCommand::class, $this->createDebugCommandDefinition());
76-
$container->register('my.type1', __CLASS__.'_Type1')->addTag('form.type');
77-
$container->register('my.type2', __CLASS__.'_Type2')->addTag('form.type');
76+
$container->register('my.type1', __CLASS__.'_Type1')->addTag('form.type')->setPublic(true);
77+
$container->register('my.type2', __CLASS__.'_Type2')->addTag('form.type')->setPublic(true);
7878

7979
$container->compile();
8080

@@ -163,6 +163,7 @@ public function testAddTaggedFormTypeExtensionWithoutExtendedTypeAttribute()
163163

164164
$container->setDefinition('form.extension', $this->createExtensionDefinition());
165165
$container->register('my.type_extension', 'stdClass')
166+
->setPublic(true)
166167
->addTag('form.type_extension');
167168

168169
$container->compile();
@@ -178,8 +179,8 @@ public function testAddTaggedGuessers()
178179
$definition2->addTag('form.type_guesser');
179180

180181
$container->setDefinition('form.extension', $this->createExtensionDefinition());
181-
$container->setDefinition('my.guesser1', $definition1);
182-
$container->setDefinition('my.guesser2', $definition2);
182+
$container->setDefinition('my.guesser1', $definition1)->setPublic(true);
183+
$container->setDefinition('my.guesser2', $definition2)->setPublic(true);
183184

184185
$container->compile();
185186

@@ -249,6 +250,7 @@ function (ContainerBuilder $container) {
249250
private function createExtensionDefinition()
250251
{
251252
$definition = new Definition('Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension');
253+
$definition->setPublic(true);
252254
$definition->setArguments(array(
253255
array(),
254256
array(),
@@ -261,6 +263,7 @@ private function createExtensionDefinition()
261263
private function createDebugCommandDefinition()
262264
{
263265
$definition = new Definition('Symfony\Component\Form\Command\DebugCommand');
266+
$definition->setPublic(true);
264267
$definition->setArguments(array(
265268
$formRegistry = $this->getMockBuilder(FormRegistryInterface::class)->getMock(),
266269
array(),

0 commit comments

Comments
 (0)