10000 minor #46656 [DependencyInjection] Add missing use statement in test … · symfony/symfony@5d11847 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d11847

Browse files
committed
minor #46656 [DependencyInjection] Add missing use statement in test (HypeMC)
This PR was merged into the 6.2 branch. Discussion ---------- [DependencyInjection] Add missing use statement in test | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Looks like #46279 removed a use statement by accident. This PR returns the missing use statement & fixes the tests. Commits ------- b03cbe6 [DependencyInjection] Add missing use statement in test
2 parents 077d4c9 + b03cbe6 commit 5d11847

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

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

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo;
2929
use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\FooInterface;
3030
use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\OtherDir\AnotherSub;
31+
use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\OtherDir\AnotherSub\DeeperBaz;
3132
use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\OtherDir\Baz;
3233
use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\Bar;
3334
use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\BarInterface;
@@ -153,7 +154,8 @@ public function testRegisterClassesWithExcludeAsArray()
153154
$this->assertTrue($container->has(Foo::class));
154155
$this->assertTrue($container->has(Baz::class));
155156
$this->assertFalse($container->has(Bar::class));
156-
$this->assertFalse($container->has(DeeperBaz::class));
157+
$this->assertTrue($container->has(DeeperBaz::class));
158+
$this->assertTrue($container->getDefinition(DeeperBaz::class)->hasTag('container.excluded'));
157159
}
158160

159161
public function testNestedRegisterClasses()
@@ -227,7 +229,7 @@ public function testRegisterClassesWithIncompatibleExclude()
227229
/**
228230
* @dataProvider excludeTrailingSlashConsistencyProvider
229231
*/
230-
public function testExcludeTrailingSlashConsistency(string $exclude)
232+
public function testExcludeTrailingSlashConsistency(string $exclude, string $excludedId)
231233
{
232234
$container = new ContainerBuilder();
233235
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
@@ -239,18 +241,19 @@ public function testExcludeTrailingSlashConsistency(string $exclude)
239241
);
240242

241243
$this->assertTrue($container->has(Foo::class));
242-
$this->assertFalse($container->has(DeeperBaz::class));
244+
$this->assertTrue($container->has($excludedId));
245+
$this->assertTrue($container->getDefinition($excludedId)->hasTag('container.excluded'));
243246
}
244247

245248
public function excludeTrailingSlashConsistencyProvider(): iterable
246249
{
247-
yield ['Prototype/OtherDir/AnotherSub/'];
248-
yield ['Prototype/OtherDir/AnotherSub'];
249-
yield ['Prototype/OtherDir/AnotherSub/*'];
250-
yield ['Prototype/*/AnotherSub'];
251-
yield ['Prototype/*/AnotherSub/'];
252-
yield ['Prototype/*/AnotherSub/*'];
253-
yield ['Prototype/OtherDir/AnotherSub/DeeperBaz.php'];
250+
yield ['Prototype/OtherDir/AnotherSub/', AnotherSub::class];
251+
yield ['Prototype/OtherDir/AnotherSub', AnotherSub::class];
252+
yield ['Prototype/OtherDir/AnotherSub/*', DeeperBaz::class];
253+
yield ['Prototype/*/AnotherSub', AnotherSub::class];
254+
yield ['Prototype/*/AnotherSub/', AnotherSub::class];
255+
yield ['Prototype/*/AnotherSub/*', DeeperBaz::class];
256+
46BF yield ['Prototype/OtherDir/AnotherSub/DeeperBaz.php', DeeperBaz::class];
254257
}
255258

256259
/**

0 commit comments

Comments
 (0)
0