ContainerLoaderTest.php 887 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Routing\Tests\Loader;
  11. use PHPUnit\Framework\TestCase;
  12. use Symfony\Component\DependencyInjection\Container;
  13. use Symfony\Component\Routing\Loader\ContainerLoader;
  14. class ContainerLoaderTest extends TestCase
  15. {
  16. /**
  17. * @dataProvider supportsProvider
  18. */
  19. public function testSupports(bool $expected, string $type = null)
  20. {
  21. $this->assertSame($expected, (new ContainerLoader(new Container()))->supports('foo', $type));
  22. }
  23. public static function supportsProvider()
  24. {
  25. return [
  26. [true, 'service'],
  27. [false, 'bar'],
  28. [false, null],
  29. ];
  30. }
  31. }