Skip to content

Commit 0f6d460

Browse files
[Config] fix path exclusion during glob discovery
1 parent c2061bc commit 0f6d460

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

Tests/Loader/FileLoaderTest.php

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Component\DependencyInjection\ContainerBuilder;
1919
use Symfony\Component\DependencyInjection\ContainerInterface;
2020
use Symfony\Component\DependencyInjection\Definition;
21-
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
2221
use Symfony\Component\DependencyInjection\Loader\FileLoader;
2322
use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
2423
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
@@ -217,32 +216,20 @@ public function testRegisterClassesWithBadPrefix()
217216
}
218217

219218
/**
220-
* @dataProvider getIncompatibleExcludeTests
219+
* @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
220+
* @expectedExceptionMessage Invalid "exclude" pattern when importing classes for "Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\": make sure your "exclude" pattern (yaml/*) is a subset of the "resource" pattern (Prototype/*)
221221
*/
222-
public function testRegisterClassesWithIncompatibleExclude($resourcePattern, $excludePattern)
222+
public function testRegisterClassesWithIncompatibleExclude()
223223
{
224224
$container = new ContainerBuilder();
225225
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
226226

227-
try {
228-
$loader->registerClasses(
229-
new Definition(),
230-
'Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\\',
231-
$resourcePattern,
232-
$excludePattern
233-
);
234-
} catch (InvalidArgumentException $e) {
235-
$this->assertEquals(
236-
sprintf('Invalid "exclude" pattern when importing classes for "Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\": make sure your "exclude" pattern (%s) is a subset of the "resource" pattern (%s)', $excludePattern, $resourcePattern),
237-
$e->getMessage()
238-
);
239-
}
240-
}
241-
242-
public function getIncompatibleExcludeTests()
243-
{
244-
yield array('Prototype/*', 'yaml/*', false);
245-
yield array('Prototype/OtherDir/*', 'Prototype/*', false);
227+
$loader->registerClasses(
228+
new Definition(),
229+
'Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\\',
230+
'Prototype/*',
231+
'yaml/*'
232+
);
246233
}
247234
}
248235

0 commit comments

Comments
 (0)