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 b03cbe6

Browse filesBrowse files
committed
[DependencyInjection] Add missing use statement in test
1 parent 7d4b42c commit b03cbe6
Copy full SHA for b03cbe6

File tree

1 file changed

+13
-10
lines changed
Filter options

1 file changed

+13
-10
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php
+13-10Lines 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+
yield ['Prototype/OtherDir/AnotherSub/DeeperBaz.php', DeeperBaz::class];
254257
}
255258

256259
/**

0 commit comments

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