ReferenceTest.php 937B

123456789101112131415161718192021222324252627282930313233
  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\Tests\Component\DependencyInjection;
  11. use Symfony\Component\DependencyInjection\Reference;
  12. class ReferenceTest extends \PHPUnit_Framework_TestCase
  13. {
  14. /**
  15. * @covers Symfony\Component\DependencyInjection\Reference::__construct
  16. */
  17. public function testConstructor()
  18. {
  19. $ref = new Reference('foo');
  20. $this->assertEquals('foo', (string) $ref, '__construct() sets the id of the reference, which is used for the __toString() method');
  21. }
  22. public function testCaseInsensitive()
  23. {
  24. $ref = new Reference('FooBar');
  25. $this->assertEquals('foobar', (string) $ref, 'the id is lowercased as the container is case insensitive');
  26. }
  27. }