LoaderExtensionTest.php 959 B

1234567891011121314151617181920212223242526272829303132
  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. require_once __DIR__.'/../../../../bootstrap.php';
  10. require_once __DIR__.'/../../../../../fixtures/Symfony/Components/DependencyInjection/includes/ProjectExtension.php';
  11. $t = new LimeTest(2);
  12. // ->load()
  13. $t->diag('->load()');
  14. $extension = new ProjectExtension();
  15. try
  16. {
  17. $extension->load('foo', array());
  18. $t->fail('->load() throws an InvalidArgumentException if the tag does not exist');
  19. }
  20. catch (InvalidArgumentException $e)
  21. {
  22. $t->pass('->load() throws an InvalidArgumentException if the tag does not exist');
  23. }
  24. $config = $extension->load('bar', array('foo' => 'bar'));
  25. $t->is($config->getParameters(), array('project.parameter.bar' => 'bar'), '->load() calls the method tied to the given tag');