LoaderExtensionTest.php 994 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /*
  3. * This file is part of the symfony package.
  4. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. namespace Symfony\Tests\Components\DependencyInjection\Loader;
  10. require_once __DIR__.'/../../../../../fixtures/Symfony/Components/DependencyInjection/includes/ProjectExtension.php';
  11. class LoaderExtensionTest extends \PHPUnit_Framework_TestCase
  12. {
  13. public function testLoad()
  14. {
  15. $extension = new \ProjectExtension();
  16. try
  17. {
  18. $extension->load('foo', array());
  19. $this->fail('->load() throws an InvalidArgumentException if the tag does not exist');
  20. }
  21. catch (\InvalidArgumentException $e)
  22. {
  23. }
  24. $config = $extension->load('bar', array('foo' => 'bar'));
  25. $this->assertEquals(array('project.parameter.bar' => 'bar'), $config->getParameters(), '->load() calls the method tied to the given tag');
  26. }
  27. }