|
18 | 18 | use Symfony\Component\DependencyInjection\ContainerBuilder;
|
19 | 19 | use Symfony\Component\DependencyInjection\ContainerInterface;
|
20 | 20 | use Symfony\Component\DependencyInjection\Definition;
|
21 |
| -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; |
22 | 21 | use Symfony\Component\DependencyInjection\Loader\FileLoader;
|
23 | 22 | use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
|
24 | 23 | use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
|
@@ -217,32 +216,20 @@ public function testRegisterClassesWithBadPrefix()
|
217 | 216 | }
|
218 | 217 |
|
219 | 218 | /**
|
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/*) |
221 | 221 | */
|
222 |
| - public function testRegisterClassesWithIncompatibleExclude($resourcePattern, $excludePattern) |
| 222 | + public function testRegisterClassesWithIncompatibleExclude() |
223 | 223 | {
|
224 | 224 | $container = new ContainerBuilder();
|
225 | 225 | $loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
|
226 | 226 |
|
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 | + ); |
246 | 233 | }
|
247 | 234 | }
|
248 | 235 |
|
|
0 commit comments